G'day all.

Quoting John Meacham <[EMAIL PROTECTED]>:

> I think it is easier just to declare it as Enum..
>
> data ParentsFlag = DontCreateParents | CreateParents
>         deriving(Enum)
>
> now (toEnum . fromEnum) will convert between ParentsFlag and Bool.

Except that it's still not clear whether True corresponds to CreateParents
or not.

I'd do it by providing functions with meaningful names, like this:

    createParentsIfTrue :: Bool -> ParentsFlag

Cheers,
Andrew Bromage
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to