The typeable-th package

[ Tags: 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]

Properties

Versions 0.1, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5
Dependencies base (==4.*), template-haskell (>=2.7.0.0 && <2.9.0.0), transformers [details]
License BSD3
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 repository head: git clone git://github.com/bennofs/typeable-th
Uploaded Tue Oct 21 13:52:59 UTC 2014 by BennoFuenfstueck
Distributions NixOS:0.1.5
Downloads 1258 total (6 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

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

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.