Description
Automatic deriving of TypeableN instances with Template Haskell.
Description
This package provides template haskell functions for deriving TypeableN instances for types of every kind, selecting the best N that is possible.
README.md
typeable-th
There is no need to manually write TypeableN instances anymore, even for complex data types! This package derives typeable instances automatically. To use it, you just have to enable a few extensions and import the package:
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE UndecidableInstances #-}
import Data.Typeable.TH
And then define your data type and call makeTypeable ''YourDataTypeName
:
data Weird a (b :: * -> *) c d = Weird
makeTypeable ''Weird
And that's it!
Contributions
Contributions and bug reports are welcome! Just fork and then sumbit a pull request if you want to implement some feature, or open a bug report to discuss the feature or bug.