User loginNavigation |
Defining a containing function on polymorphic listI am trying to define a containing function to see if a value is one of the elements within a list which is polymorphic, but failed with the following codes: contain :: a -> [a] -> Bool> contain x [] = False > contain x (y:ys) = if x == y then True else contain x ys it seems that the problem is the 'operator' == does not support a polymorphic check? Any way can solve the problem? or any alternative solution to achieve the purpose? Thanks! Raeck By raeck at 2008-12-22 03:41 | LtU Forum | previous forum topic | next forum topic | other blogs | 4188 reads
|
Browse archives
Active forum topics
|
Recent comments
16 weeks 1 day ago
20 weeks 3 days ago
22 weeks 6 hours ago
22 weeks 6 hours ago
24 weeks 5 days ago
29 weeks 2 days ago
29 weeks 2 days ago
29 weeks 5 days ago
29 weeks 5 days ago
32 weeks 4 days ago