typeable-th: Automatic deriving of TypeableN instances with Template Haskell

[ bsd3, data, library ] [ Propose Tags ]

This package provides template haskell functions for deriving TypeableN instances for types of every kind, selecting the best N that is possible.

[Skip to Readme]
Versions [faq] 0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5
Dependencies base (==4.*), template-haskell (>= && <, transformers [details]
License BSD-3-Clause
Copyright Copyright (C) 2013 Benno Fünfstück
Author Benno Fünfstück
Maintainer benno.fuenfstueck@gmail.com
Category Data
Home page http://github.com/bennofs/typeable-th
Bug tracker http://github.com/bennofs/typeable-th/issues
Source repo head: git clone git://github.com/bennofs/typeable-th
Uploaded by BennoFuenfstueck at 2014-10-21T13:52:59Z
Distributions NixOS:0.1.5
Downloads 3728 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees

Readme for typeable-th-0.1.5

[back to package description]

typeable-th Build Status

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 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.