[Haskell] ANN: Data.Derive 0.1
Neil Mitchell
ndmitchell at gmail.com
Sun May 27 17:59:46 EDT 2007
Hi
I am pleased to announce Data.Derive.
Webpage: http://www-users.cs.york.ac.uk/~ndm/derive/
Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/derive-0.1
Manual: http://www.cs.york.ac.uk/fp/darcs/derive/derive.htm
>From the Manual:
"Data.Derive is a library and a tool for deriving instances for
Haskell programs. It is designed to work with custom derivations, SYB
and Template Haskell mechanisms. The tool requires GHC, but the
generated code is portable to all compilers. We see this tool as a
competitor to DrIFT."
To take a very small example, imagine you define your data structure:
data Foo = ...
Now you can derive instances using derive with --derive=Eq,Data,Serial
etc. You can also use deriving ({-! Typeable, Show !-}) and $( derive
makeEq ''Foo ).
Advantages over DrIFT:
* No need for a preprocessor with GHC
* Easy to add new derivations outside of the library
* Can often automatically infer instances from examples (see the manual)
* A different set of instance derivations
Thanks
Neil
(Co-authored with Stefan O'Rear, thanks to many others for code contributions!)
More information about the Haskell
mailing list