hGet package:hset
Gets any data from HSet for you
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)
>>> let y = HSCons (Tagged 10 :: Tagged "x" Int) $ HSCons (Tagged 20 :: Tagged "y" Int) HSNil
>>> y
HSCons (Tagged 10) (HSCons (Tagged 20) (HSNil))
>>> hgetTagged (Proxy :: Proxy "x") y :: Int
10
>>> hgetTagged (Proxy :: Proxy "y") y :: Int
20
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.