hset-2.0.0: Primitive list with elements of unique types.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.HSet.Get

Synopsis

Documentation

class (i ~ Index e els) => HGet els e i | els i -> e where Source

Heterogeneous read arbitrarily element from hset

>>> let x = HSCons (10 :: Int) $ HSCons (20 :: Double) HSNil
>>> x
HSCons (10) (HSCons (20.0) (HSNil))
>>> hget x :: Int
10
>>> hget x :: Double
20.0

Note that hget takes specific element from list of uniquely typed elements depending on what type is required to be returned (return type polymorphism)

Methods

hget :: HSet els -> e Source

Gets any data from HSet for you

Instances

HGet ((:) * e els) e Z 
((~) Nat (S i) (Index * e ((:) * e1 els)), HGet els e i) => HGet ((:) * e1 els) e (S i) 

type HGettable els e = HGet els e (Index e els) Source

Enables deriving of the fact that e is contained within els and it's safe to say that hget can be performed on this particular pair.