Skip to content

haskell-pkg-janitors/template-default

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

template-default

declaring Default instances just got even easier

Declaring instances of the Default type class has always been pretty mechanical. This package makes the compiler do the mechanical bit. This has the benefit that even less thought is required, and the instance will automatically be corrected when the definition of the data type changes (say, to add more arguments to the constructor). Usage looks like this:

{-# LANGUAGE TemplateHaskell #-}
import Data.Default.TH
deriveDefault ''MyFancyTypeName

About

Make declaring Default instances for your Haskell data types even easier

Resources

License

Stars

Watchers

Forks

Packages

No packages published