
25 May
2005
25 May
'05
12:32 a.m.
G'day all.
Quoting John Meacham
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