extensible-0.2.6: Extensible, efficient, lens-friendly data types

Copyright(c) Fumiaki Kinoshita 2015
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Extensible

Contents

Description

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

Synopsis

Reexport