-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Entity based records -- -- Usage: http://github.com/nonowarn/has/blob/master/README.md -- -- And its examples and test would be helpful: -- -- @package has @version 0.3 -- | Entiry based records. module Data.Has -- | Same as Knows lab (TypeOf lab) s, Useful on writing type -- signitures. -- -- Holds e == (lab .^ (lab ^= e $ s)) where lab :: lab; e :: -- TypeOf lab; s :: s class (Knows lab (TypeOf lab) s) => Has lab s -- | Row a is a type list which contains only one element of -- a. And every row in the records should be this type. type Row a = a ::: TyNil -- | Concatenates between Rows or records. Records are concatenated -- rows. For example, Following expressions are valid. -- --
--   -- Concatenation of rows (i.e. record)
--   row "string" & row True
--   
-- --
--   -- Concatenation of records
--   (row 'c' & row ()) & (row False & row "string")
--   
-- --
--   -- ... And concatenations between a row and a record
--   row () & (row False & row "string")
--   (row 'c' & row ()) & row False
--   
(&) :: (Append a b) => a -> b -> a :&: b -- | Represents concatenated rows or records. -- | Creates a Row of a. row :: a -> Row a -- | Strict version of injl (^=) :: (Knows lab (TypeOf lab) s) => lab -> TypeOf lab -> s -> s -- | Strict version of prjl (^.) :: (Knows lab (TypeOf lab) s) => lab -> s -> TypeOf lab -- | Strict version of updl (^:) :: (Knows lab (TypeOf lab) s) => lab -> (TypeOf lab -> TypeOf lab) -> (s -> s) -- | Injects and Projects a labelled values into records. class (Contains (Labelled lab e) s) => Knows lab e s | lab s -> e injl :: (Knows lab e s) => lab -> e -> s -> s prjl :: (Knows lab e s) => lab -> s -> e -- | Updates a labelled value updl :: (Knows lab b a) => lab -> (b -> b) -> (a -> a) -- | Represents labelled value. data Labelled lab a -- | Represents labelled row. type :> lab a = Row (Labelled lab a) -- | Makes a labelled row. (.>) :: lab -> a -> lab :> a -- | TypeOf a should indicate a type labelled by a -- |
--   RowOf a == a :> TypeOf a
--   
-- | Creates a row labelled by a rowOf :: TypeOf a -> RowOf a -- | Cons a type onto type-list. data (:::) a b -- | The empty type-list. data TyNil -- | Provides injection and projection into type lists. -- -- Holds e == prj (inj e s) for all s and e. class Contains e s instance (Eq a) => Eq (Labelled lab a) instance (Ord a) => Ord (Labelled lab a) instance (Show a) => Show (Labelled lab a) instance (Read a) => Read (Labelled lab a) instance (Bounded a) => Bounded (Labelled lab a) instance (CoArbitrary a) => CoArbitrary (Labelled lab a) instance (Arbitrary a) => Arbitrary (Labelled lab a) instance (Monoid a) => Monoid (Labelled lab a) instance (Knows lab (TypeOf lab) s) => Has lab s instance (Contains (Labelled lab e) s) => Knows lab e s