Derive
This library provides a framework for deriving instances, using GHC and Template Haskell. It can be seen as an alternative to DrIFT.
Acknowledgements
Thanks to Stefan O'Rear for being co-author of the tool. Thanks Twan van Laarhoven for contributing Functor deriving.
Downloads
- Released version
- Instances for Free - from PLASMA (bibtex)(hide bibtex)
@misc{mitchell:derive_2008_5_22
,title = "Instances for Free"
,author = "Neil Mitchell"
,year = "2008"
,month = "May"
,day = "22"
,note = "Presentation from PLASMA"
,url = "\verb'http://www-users.cs.york.ac.uk/~ndm/downloads/slides-instances_for_free-22_may_2008.pdf'"
}
- Deriving Generic Functions by Example - from York Doctoral Symposium 2007 (abstract)(hide abstract)
A function is said to be generic if it operates over values of
any data type. For example, a generic equality function can test pairs of
booleans, integers, lists, trees etc. In most languages programmers must
define generic functions multiple times, specialised for each data type.
Alternatively, a tool could be used to specify the relationship between the
data type and the implementation, but this relationship may be complex.
This paper describes a solution: given a single example of the generic
function on one data type, we can infer the relationship between a data
type and the implementation. We have used our method in the Derive
tool, allowing the implementation of 60% of the generic functions to be
inferred.
(bibtex)(hide bibtex)@inproceedings{mitchell:derive_2007_10_26
,title = "Deriving Generic Functions by Example"
,author = "Neil Mitchell"
,year = "2007"
,month = "October"
,day = "26"
,pages = "55--62
,publisher = "Tech. Report YCS-2007-421, Dept. of Computer Science, University of York, UK"
,editor = "Jan Tobias M\"{u}hlberg and Juan Ignacio Perna"
,url = "\verb'http://www-users.cs.york.ac.uk/~ndm/downloads/paper-deriving_generic_functions_by_example-26_oct_2007.pdf'"
}
Tags: haskell library popular program