HList-0.2: Heterogeneous listsSource codeContentsIndex
Data.HList.GhcSyntax
Synopsis
type :*: e l = HCons e l
(.*.) :: HExtend e l l' => e -> l -> l'
type :=: l v = LVPair l v
(.=.) :: l -> v -> LVPair l v
(.!.) :: HasField l r v => r -> l -> v
type :+: e l = HCons (Proxy e) l
Documentation
type :*: e l = HCons e lSource
(.*.) :: HExtend e l l' => e -> l -> l'Source

(.*.) -- Add a field to a record. Analagous to (++) for lists.

record .*. field1 .*. field2 -

type :=: l v = LVPair l vSource
(.=.) :: l -> v -> LVPair l vSource

(.=.) -- Create a value with the given label. Analagous to a data constructor such as Just, Left, or Right. Higher fixity than record-modification operations like (.*.), (.-.), etc. to support expression like the below w/o parentheses:

label1 .=. value1 .*. label2 .=. value2 .*. emptyRecord

(.!.) :: HasField l r v => r -> l -> vSource

(.!.) -- Lookup a value in a record, by its label. Analagous to (!!), the list indexing operation. Highest fixity, like (!!).

record1 .*. label1 .=. record2 .!. label1 .*. label2 .=. record2 .!. label2 -

type :+: e l = HCons (Proxy e) lSource

(.-.) -- Remove a field from a record. At the same level as other record modification options (.*.). Analagous to (\) in lists.

record1 .-. label1

label1 .=. value1 .*. label2 .=. value2 .-. label2 .*. emptyRecord

label1 .=. value1 .-. label1 .*. label2 .=. value2 .*. emptyRecord

record1 .*. label1 .=. record2 .!. label1 .*. label2 .=. record2 .!. label2 .-. label1 -

(..) -- Update a field with a particular value. Another record-level operation, so it has the same fixity as (.*.) and (.-.). No real list analogue, since there is no Prelude defined update. record1 .. label1 .=. value1

record1 .. label1 .=. record2 .!. label1 record1 .*. label1 .=. record2 .!. label1 .*. label2 .=. record2 .!. label2 .. label1 .=. value2

(.^.) -- This is a variation on updating (according to GhcRecord.hs), so use the same fixity as (.@.).

(.<.) -- Another variation on update, so give it the same fixity as (.@.).

(.<++.) -- Similar to list append, so give this slightly lower fixity than (.*.), so we can write:

record1 .*. field1 .<++. record2 .*. field2

Produced by Haddock version 2.4.2