Copyright | (c) Fumiaki Kinoshita 2015 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This package defines an extensible type-indexed product type and a union type.
Extensible ADTs provided by this module are determined from a type-level list [k]
and a wrapper k -> *
.
We can define ADTs not only for plain values, but also parameterized ones.
>>>
let t = K0 (42 :: Int) <:* K0 "foo" <:* K0 (Just "bar") <:* Nil
>>>
t
K0 42 <:* K0 "foo" <:* K0 (Just "bar") <:* Nil>>>
:t t
t :: K0 :* '[Int, [Char], Maybe [Char]]>>>
pluck t :: Int
42
- module Data.Extensible.Dictionary
- module Data.Extensible.Inclusion
- module Data.Extensible.Match
- module Data.Extensible.Plain
- module Data.Extensible.Record
- module Data.Extensible.Product
- module Data.Extensible.Sum
- newtype Comp f g a = Comp {
- getComp :: f (g a)
- comp :: Functor f => (a -> g b) -> f a -> Comp f g b
Reexport
module Data.Extensible.Dictionary
module Data.Extensible.Inclusion
module Data.Extensible.Match
module Data.Extensible.Plain
module Data.Extensible.Record
module Data.Extensible.Product
module Data.Extensible.Sum