has-0.2: Generic Haskell's Record Accessors

Data.Has

Description

Provides some pliant data types and functions.

Synopsis

Documentation

data a :*: b Source

Represents Type level list.

Constructors

a :*: b 

Instances

(MayHas e h, MayHas e t) => MayHas e (:*: h t) 
(TyOr x y b, Contains e h x, Contains e t y) => Contains e (:*: h t) b 
(Bounded a, Bounded b) => Bounded (:*: a b) 
(Eq a, Eq b) => Eq (:*: a b) 
(Ord a, Ord b) => Ord (:*: a b) 
(Read a, Read b) => Read (:*: a b) 
(Show a, Show b) => Show (:*: a b) 

class Has e s whereSource

Provides plient function. Holds e == prj (inj e s) for all s and e.

Methods

inj :: e -> s -> sSource

Injects a value of type e into s if s contains the type e.

prj :: s -> eSource

Projects a value of type e out from s if s contains the type e.

Instances

(MayHas e s, Contains e s TyTrue) => Has e s 

upd :: Has e s => (e -> e) -> s -> sSource

Updates a value e in s, using given function e -> e.