extensible-0.2.3: Poly-kinded, extensible ADTs

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

Data.Extensible.Inclusion

Description

 

Synopsis

Documentation

data Position xs x Source

The position of x in the type level set xs.

Instances

Typeable ([k] -> k -> *) (Position k) 
Eq (Position k xs x) 
Ord (Position k xs x) 
Show (Position k xs x) 

runPosition :: Position (y : xs) x -> Either (x :~: y) (Position xs x) Source

Embodies a type equivalence to ensure that the Position points the first element.

type (∈) x xs = Member xs x Source

Unicode flipped alias for Member

class Member xs x where Source

Member x xs or x ∈ xs indicates that x is an element of xs.

Methods

membership :: Position xs x Source

Instances

((~) * (Check k1 Nat x (Lookup k1 x xs)) (Expecting k one), ToInt k one) => Member k xs x 

data Expecting a Source

A type sugar to make type error more readable.

data Missing a Source

A type sugar to make type error more readable.

data Ambiguous a Source

A type sugar to make type error more readable.

ord :: Int -> Q Exp Source

Generates Position for an ordinal (0-origin).

type (⊆) xs ys = Include ys xs Source

Unicode alias for Include

type Include ys = Forall (Member ys) Source

ys contains xs

inclusion :: forall xs ys. Include ys xs => Position ys :* xs Source

Reify the inclusion of type level sets.

shrink :: xs ys => (h :* ys) -> h :* xs Source

O(m log n) Select some elements.

spread :: xs ys => (h :| xs) -> h :| ys Source

O(log n) Embed to a larger union.