Name: Anonymous 2007-11-20 20:55
Did you know that types are curried?
Let's try it out!
-- Your friendly Haskell tipster :).
Prelude> :kind Either
Either :: * -> * -> *
Prelude> :kind Either Bool
Either Bool :: * -> *Let's try it out!
type ThrowsError = Either String
safeDivide :: (Fractional a) => a -> a -> ThrowsError a
_ `safeDivide` 0 = Left "cannot divide by zero"
(safeDivide) = Right `dot` (/) where dot = (.) . (.)-- Your friendly Haskell tipster :).