When I check the type of dividedBy, I get
*Lib> :t dividedBy
dividedBy :: (Num b, Ord b) => b -> b -> DividedResult
However, if I try to add the type declaration line:
dividedBy :: (Num a, DividedResult b) => a -> a -> b
* Black Swan:
When I check the type of dividedBy, I get
*Lib> :t dividedBy
dividedBy :: (Num b, Ord b) => b -> b -> DividedResult
However, if I try to add the type declaration line:
dividedBy :: (Num a, DividedResult b) => a -> a -> b
These two types are not the same. Why do you think the second type
would work? There are two problems: DividedResult doesn't take a type parameter, and functions of types as general as Num a => a -> b do not
really exist.
* Black Swan:
When I check the type of dividedBy, I get
*Lib> :t dividedBy
dividedBy :: (Num b, Ord b) => b -> b -> DividedResult
However, if I try to add the type declaration line:
dividedBy :: (Num a, DividedResult b) => a -> a -> b
These two types are not the same. Why do you think the second type
would work? There are two problems: DividedResult doesn't take a type parameter, and functions of types as general as Num a => a -> b do not
really exist.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 295 |
Nodes: | 16 (2 / 14) |
Uptime: | 19:32:23 |
Calls: | 6,640 |
Files: | 12,188 |
Messages: | 5,325,232 |