On Wednesday 25 May 2005 01:09, Daniel Fischer wrote: > Am Mittwoch, 25. Mai 2005 00:46 schrieb Benjamin Franksen: > > On Wednesday 25 May 2005 00:11, Jan-Willem Maessen wrote: > > > On May 24, 2005, at 5:28 PM, John Meacham wrote: > > > > [various ways of capturing options passed to functions > > > > discussed...] > > > > > > > > data ParentsFlag = DontCreateParents | CreateParents > > > > deriving(Enum) > > > > > [more discussion...] > > What about a type synonym? I think > > type CreateParents = Bool
The thread started about readability at the call site. Using a type synonym for Bool needs to figure out what this "True" at call site means instead of understanding it right away. What about adding to the Daniel's definition: don'tCreateParents :: CreateParents don'tCreateParents = False createParents :: CreateParents createParents = True I'm not finding this fancy as the library user is not required to use them. Using constructors also emphasis which are options and which are not. Cheers, Jérémy.
pgp8pyN6T96kf.pgp
Description: PGP signature
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe