The ungadtagger package

[Tags:bsd3, library]

UnGADTagger encapsulates abstraction-from-GADT-tag workflow by utilizing existentials, rank2-types and kind polymorphism.

An example:

 # LANGUAGE GADTs, DataKinds, KindSignatures, LambdaCase #

 import Data.GADT.Untagged

 data Tag = A | B

 data Gadt :: Tag -> * where
   ConA :: String   -> Gadt A
   ConB :: [Gadt A] -> Gadt B
   ConC :: Integer  -> Gadt B

 foo :: something -> [Untagged Gadt] -> String
 foo _ = quux
   where
     quux  = concat . map baz
     baz x = match x $ \case
       ConA s  -> s
       ConB xs -> quux (map untag xs)
       ConC i  -> show i

 test = foo "some cfg for e.g." (xs ++ ys)
   where
     xs = map untag [ConA "A1..", ConA "A2.."]
     ys = map untag [ConB [ConA "A3.."], ConC 456]

 -- > "A1..A2..A3..456"

Properties

Versions 1.0.0
Dependencies base (==4.*) [details]
License BSD3
Copyright (c) 2012 Andriy Polishchuk
Author Andriy Polishchuk
Maintainer Andriy Polishchuk <andriy.s.polishchuk@gmail.com>
Stability Unknown
Category Data
Home page http://github.com/andriyp/ungadtagger
Bug tracker http://github.com/andriyp/ungadtagger/issues
Source repository head: git clone git://github.com/andriyp/ungadtagger.git
Uploaded Sun Sep 30 07:20:26 UTC 2012 by AndriyPolishchuk
Distributions NixOS:1.0.0
Downloads 286 total (6 in the last 30 days)
Votes
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees