
18 Jan
2001
18 Jan
'01
7:34 p.m.
Ashley Yakeley writes:
At 2001-01-18 15:38, I wrote:
3 is not always an Integer. It's of type "(Num a) => a".
Of course, it would be nice if 3 were an Integer, and Integer were a subtype of Real. I haven't come across a language that does this, where for instance 3.0 can be cast to Integer (because it is one) but 3.1 cannot be.
A cast in that direction - becoming more specific - would be nicely typed as: Real -> Maybe Integer or with the help of the fail and return methods: Monad m => Real -> m Integer
8887
Age (days ago)
8887
Last active (days ago)
0 comments
1 participants
participants (1)
-
Tom Pledger