serv-wai-0.2.0.0: Dependently typed API servers with Serv

Safe HaskellNone
LanguageHaskell2010

Serv.Wai.Rec

Contents

Description

Re-exports of useful Data.Vinyl Rec types

Synopsis

Specialized records

FieldRec

data ElField field where Source

A more kind polymorphic element field than what's normally available in Data.Vinyl

Constructors

ElField :: Sing k -> !a -> ElField `(k, a)` 

type FieldRec hs = Rec ElField hs Source

A FieldRec is a record of types tagged by some kind of "name".

HList

newtype Identity a :: * -> *

Identity functor and monad. (a non-strict monad)

Since: 4.8.0.0

Constructors

Identity 

Fields

runIdentity :: a
 

Instances

Monad Identity 
Functor Identity 
MonadFix Identity 
Applicative Identity 
Foldable Identity 
Traversable Identity 
Generic1 Identity 
MonadZip Identity 
Eq1 Identity 
Ord1 Identity 
Read1 Identity 
Show1 Identity 
Eq a => Eq (Identity a) 
Data a => Data (Identity a) 
Ord a => Ord (Identity a) 
Read a => Read (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Show a => Show (Identity a)

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Generic (Identity a) 
Semigroup a => Semigroup (Identity a) 
type Rep1 Identity = D1 D1Identity (C1 C1_0Identity (S1 S1_0_0Identity Par1)) 
type Rep (Identity a) = D1 D1Identity (C1 C1_0Identity (S1 S1_0_0Identity (Rec0 a))) 

(=:) :: Sing a -> v -> FieldRec `[`(a, v)`]` Source

data Rec a b :: (u -> *) -> [u] -> * where

A record is parameterized by a universe u, an interpretation f and a list of rows rs. The labels or indices of the record are given by inhabitants of the kind u; the type of values at any label r :: u is given by its interpretation f r :: *.

Constructors

RNil :: Rec u a ([] u) 
(:&) :: !(a r) -> !(Rec u a rs) -> Rec u a ((:) u r rs) infixr 7 

Instances

Eq (Rec k f ([] k)) 
(Eq (f r), Eq (Rec k f rs)) => Eq (Rec k f ((:) k r rs)) 
Ord (Rec k f ([] k)) 
(Ord (f r), Ord (Rec k f rs)) => Ord (Rec k f ((:) k r rs)) 
RecAll k f rs Show => Show (Rec k f rs)

Records may be shown insofar as their points may be shown. reifyConstraint is used to great effect here.

Storable (Rec k f ([] k)) 
(Storable (f r), Storable (Rec k f rs)) => Storable (Rec k f ((:) k r rs)) 
Monoid (Rec k f ([] k)) 
(Monoid (f r), Monoid (Rec k f rs)) => Monoid (Rec k f ((:) k r rs)) 

(<+>) :: Rec k f as -> Rec k f bs -> Rec k f ((++) k as bs) infixr 5

A shorthand for rappend.

(++) :: [a] -> [a] -> [a] infixr 5

Append two lists, i.e.,

[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]

If the first list is not finite, the result is the first list.

Type-level methods

type family as ++ bs :: [k]

Append for type-level lists.

Equations

(k ++ ([] k)) bs = bs 
(k ++ ((:) k a as)) bs = (:) k a ((++) k as bs)