
21 Jan
2002
21 Jan
'02
5:19 a.m.
At 2002-01-21 02:04, Koen Claessen wrote:
But from the type you give the function `emptyList':
emptyList :: Ord a => [a]
we cannot derive that the type of the function `emptyList' does not matter for its result. So, the type checker will complain.
That's it! Consider: -- class C a where emptyList :: [a] instance C Int where emptyList = [] instance C Char where emptyList = "Hello" -- Clearly emptyList has type "(C a) => [a]"... So in the original example, (validActions actor) cannot be compared to the empty list because its value may depend on the type of u. This would not be possible if there were no (Action u) context. -- Ashley Yakeley, Seattle WA
8521
Age (days ago)
8521
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ashley Yakeley