[Haskell-beginners] flip lookup in ghci

Matt R mattrussell324 at googlemail.com
Fri Feb 20 05:27:50 EST 2009


So what's this all about then? How come a has become ()?

  ghci> :t lookup
  lookup :: (Eq a) => a -> [(a, b)] -> Maybe b
  ghci> :t flip lookup
  flip lookup :: (Eq a) => [(a, b)] -> a -> Maybe b
  ghci> let lookupIn = (flip lookup :: (Eq a) => [(a, b)] -> a -> Maybe b )
  ghci> :t lookupIn
  lookupIn :: [((), b)] -> () -> Maybe b


More information about the Beginners mailing list