[Haskell-beginners] How are complex Errors implemented

Brandon Allbery allbery.b at gmail.com
Wed Jun 8 18:52:39 CEST 2011

On Wed, Jun 8, 2011 at 12:45, Christopher Howard
<christopher.howard at frigidcode.com> wrote:
> Reason I ask: Lets say I want to create my own error type which is a
> member of Error, but has multiple record fields. How would I implement
> noMsg and strMsg?

However you want.  The thing to keep in mind is that those are the
required constructors, but need not be the *only* constructors; your
code would use other constructors that provide more information, while
noMsg and strMsg are used by generic code that wouldn't know what to
do with your additional fields anyway.  So pick saneish defaults.

More information about the Beginners mailing list