Monad class contains declaration

*fail* :: String -> m a

and provides default implementation for 'fail' as:

fail s = error s

On the other hand Prelude defines:
*
error* :: String -> a

which stops execution and displays an error message.

Questions:
1) What value and type 'error' actually returns in:
error "some message" ?

2) How declaration
String -> m a
matches with
String -> a ?

3) In Maybe monad:
fail = Nothing

When and how 'fail' is used in Maybe monad?

Thanks!

--
Dmitri O. Kondratiev
[EMAIL PROTECTED]
http://www.geocities.com/dkondr
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to