You can use the error function. It accepts a string that is displayed
when the error is evaluated:
GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> error "hi!"
*** Exception: hi!
HTH,
Martijn.
Andrew U. Frank wrote:
is there a way to have different kinds of undefined? such that i get a message
which one was hit. something like writing in the code 'unefined 'my error 123'
which prints 'undefined - my error 123' when it is accidentally hit.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe