
25 Feb
2008
25 Feb
'08
7:48 p.m.
Am Dienstag, 26. Februar 2008 01:32 schrieb Ben:
Ok, that makes sense. There's no num k that's both Fractional and Integral, where as in the case where I had the number literals, those were two different instances. What's the usual way of working around this? Something like
(\k -> (1/ fromInteger k) ^ k) 3
?
Or use another exponentiation operator, in this case (**), (\k -> (1/k)**k) :: (Floating t) => t -> t, so in (\k -> (1/k)**k) 3, fromInteger 3 will have type (Floating t) => t and that will be defaulted to Double Cheers, Daniel