type-sets-0.1.1.0: Type-level sets

Safe HaskellNone
LanguageHaskell2010

Type.RBSet

Contents

Description

See here for the original term-level code by Stefan Kahrs.

Since: 0.1.1.0

Synopsis

Core type

data TypeSet a Source #

A Red-Black tree.

Since: 0.1.1.0

Constructors

E 
N Color (TypeSet a) a (TypeSet a) 
Instances
Eq a => Eq (TypeSet a) Source # 
Instance details

Defined in Type.RBSet

Methods

(==) :: TypeSet a -> TypeSet a -> Bool #

(/=) :: TypeSet a -> TypeSet a -> Bool #

Show a => Show (TypeSet a) Source # 
Instance details

Defined in Type.RBSet

Methods

showsPrec :: Int -> TypeSet a -> ShowS #

show :: TypeSet a -> String #

showList :: [TypeSet a] -> ShowS #

type Empty = E Source #

A map without entries.

Set operations

type family Member (t :: k) (bst :: TypeSet k) :: Bool where ... Source #

O(log n). Determine membership in the 'TypeSet.'

Equations

Member t E = False 
Member t (N _ lbst a rbst) = MemberImpl (CmpType t a) t lbst rbst 

class Insertable (k :: ki) (t :: TypeSet ki) Source #

The associated type family Insert produces the resulting map.

Associated Types

type Insert k t :: TypeSet ki Source #

Instances
(InsertableHelper1 k t, Insert1 k t ~ inserted, CanMakeBlack inserted) => Insertable (k :: ki) (t :: TypeSet ki) Source # 
Instance details

Defined in Type.RBSet

Associated Types

type Insert k t :: TypeSet ki Source #

type family InsertAll (es :: [k]) (t :: TypeSet k) :: TypeSet k where ... Source #

Insert a list of type level key / value pairs into a type-level map.

Equations

InsertAll '[] t = t 
InsertAll (v ': es) t = Insert v (InsertAll es t) 

type FromList (es :: [k]) = InsertAll es Empty Source #

Build a type-level map out of a list of type level key / value pairs.

class Removable (k :: ki) (t :: TypeSet ki) Source #

The associated type family Remove produces the resulting map.

Associated Types

type Remove k t :: TypeSet ki Source #

Instances
(Delable k t, Del k t ~ deleted, CanMakeBlack deleted) => Removable (k :: ki) (t :: TypeSet ki) Source # 
Instance details

Defined in Type.RBSet

Associated Types

type Remove k t :: TypeSet ki Source #

type family Merge (small :: TypeSet k) (big :: TypeSet k) :: TypeSet k where ... Source #

O(m log n) for Merge m n; put your smaller set on the left side. Merge two TypeSets together.

Equations

Merge Empty big = big 
Merge small Empty = small 
Merge (N _ lbst a rbst) big = Merge rbst (Merge lbst (Insert a big))