
13 Aug
2009
13 Aug
'09
11:25 a.m.
Can anyone help me understand the behavior of the following expressions in ghci? I was trying to construct a flipped function 'elem' that would accept a list of characters first but I ran into this problem with the type signature. Thank you. Prelude Data.List Data.Char> :t elem elem :: (Eq a) => a -> [a] -> Bool -- OK Prelude Data.List Data.Char> :t (flip elem) (flip elem) :: (Eq a) => [a] -> a -> Bool -- OK this is what I want Prelude Data.List Data.Char> let fElem = (flip elem) Prelude Data.List Data.Char> :t fElem fElem :: [()] -> () -> Bool -- ?? Function will not accept a [Char]