Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Row types
Synopsis
- class (Ord (RowConstraintsKey constraints), TypeConstraints constraints) => RowConstraints constraints where
- type RowConstraintsKey constraints
- forbidden :: Lens' constraints (Set (RowConstraintsKey constraints))
- type RowKey typ = RowConstraintsKey (TypeConstraintsOf typ)
- data RowExtend key val rest h = RowExtend {}
- eKey :: forall key val rest h key. Lens (RowExtend key val rest h) (RowExtend key val rest h) key key
- eVal :: forall key val rest h val. Lens (RowExtend key val rest h) (RowExtend key val rest h) ((:#) h val) ((:#) h val)
- eRest :: forall key val rest h rest. Lens (RowExtend key val rest h) (RowExtend key val rest h) ((:#) h rest) ((:#) h rest)
- data W_RowExtend (key :: Type) (val :: HyperType) (rest :: HyperType) node where
- W_RowExtend_val :: W_RowExtend key val rest val
- W_RowExtend_rest :: W_RowExtend key val rest rest
- data FlatRowExtends key val rest h = FlatRowExtends {
- _freExtends :: Map key (h :# val)
- _freRest :: h :# rest
- freExtends :: forall key val rest h key val. Lens (FlatRowExtends key val rest h) (FlatRowExtends key val rest h) (Map key ((:#) h val)) (Map key ((:#) h val))
- freRest :: forall key val rest h rest. Lens (FlatRowExtends key val rest h) (FlatRowExtends key val rest h) ((:#) h rest) ((:#) h rest)
- data W_FlatRowExtends (key :: Type) (val :: HyperType) (rest :: HyperType) node where
- W_FlatRowExtends_val :: W_FlatRowExtends key val rest val
- W_FlatRowExtends_rest :: W_FlatRowExtends key val rest rest
- data family MorphWitness s t :: HyperType -> HyperType -> Type
- flattenRow :: (Ord key, Monad m) => ((v # rest) -> m (Maybe (RowExtend key val rest # v))) -> (v # rest) -> m (FlatRowExtends key val rest # v)
- flattenRowExtend :: (Ord key, Monad m) => ((v # rest) -> m (Maybe (RowExtend key val rest # v))) -> (RowExtend key val rest # v) -> m (FlatRowExtends key val rest # v)
- unflattenRow :: Monad m => ((RowExtend key val rest # v) -> m (v # rest)) -> (FlatRowExtends key val rest # v) -> m (v # rest)
- verifyRowExtendConstraints :: RowConstraints (TypeConstraintsOf rowTyp) => (TypeConstraintsOf rowTyp -> TypeConstraintsOf valTyp) -> TypeConstraintsOf rowTyp -> (RowExtend (RowKey rowTyp) valTyp rowTyp # h) -> Maybe (RowExtend (RowKey rowTyp) valTyp rowTyp # WithConstraint h)
- rowExtendStructureMismatch :: Ord key => (Unify m rowTyp, Unify m valTyp) => (forall c. Unify m c => (UVarOf m # c) -> (UVarOf m # c) -> m (UVarOf m # c)) -> Prism' (rowTyp # UVarOf m) (RowExtend key valTyp rowTyp # UVarOf m) -> (RowExtend key valTyp rowTyp # UVarOf m) -> (RowExtend key valTyp rowTyp # UVarOf m) -> m ()
- rowElementInfer :: forall m valTyp rowTyp. (UnifyGen m valTyp, UnifyGen m rowTyp, RowConstraints (TypeConstraintsOf rowTyp)) => ((RowExtend (RowKey rowTyp) valTyp rowTyp # UVarOf m) -> rowTyp # UVarOf m) -> RowKey rowTyp -> m (UVarOf m # valTyp, UVarOf m # rowTyp)
Documentation
class (Ord (RowConstraintsKey constraints), TypeConstraints constraints) => RowConstraints constraints where Source #
type RowConstraintsKey constraints Source #
type RowKey typ = RowConstraintsKey (TypeConstraintsOf typ) Source #
data RowExtend key val rest h Source #
Row-extend primitive for use in both value-level and type-level
Instances
Semigroup key => HApply (RowExtend key val rest) Source # | |
HContext (RowExtend key val rest) Source # | |
HFoldable (RowExtend key val rest) Source # | |
HFunctor (RowExtend key val rest) Source # | |
HNodes (RowExtend key val rest) Source # | |
Defined in Hyper.Syntax.Row type HNodesConstraint (RowExtend key val rest) c Source # type HWitnessType (RowExtend key val rest) :: HyperType -> Type Source # hLiftConstraint :: forall c (n :: HyperType) r. HNodesConstraint (RowExtend key val rest) c => HWitness (RowExtend key val rest) n -> Proxy c -> (c n => r) -> r Source # | |
Monoid key => HPointed (RowExtend key val rest) Source # | |
HTraversable (RowExtend key val rest) Source # | |
Defined in Hyper.Syntax.Row hsequence :: forall f (p :: AHyperType -> Type). Applicative f => (RowExtend key val rest # ContainedH f p) -> f (RowExtend key val rest # p) Source # | |
Eq key => ZipMatch (RowExtend key val rest) Source # | |
HMorph (RowExtend key val0 rest0) (RowExtend key val1 rest1) Source # | |
Defined in Hyper.Syntax.Row type MorphConstraint (RowExtend key val0 rest0) (RowExtend key val1 rest1) c Source # data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) :: HyperType -> HyperType -> Type Source # morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) a b -> (p # a) -> q # b) -> (RowExtend key val0 rest0 # p) -> RowExtend key val1 rest1 # q Source # morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (RowExtend key val0 rest0) (RowExtend key val1 rest1) c => MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) a b -> Proxy c -> (c a b => r) -> r Source # | |
Generic (RowExtend key val rest h) Source # | |
Constraints (RowExtend key val rest h) Show => Show (RowExtend key val rest h) Source # | |
Constraints (RowExtend key val rest h) Binary => Binary (RowExtend key val rest h) Source # | |
Constraints (RowExtend key val rest h) NFData => NFData (RowExtend key val rest h) Source # | |
Defined in Hyper.Syntax.Row | |
Constraints (RowExtend key val rest h) Eq => Eq (RowExtend key val rest h) Source # | |
Constraints (RowExtend key val rest h) Ord => Ord (RowExtend key val rest h) Source # | |
Defined in Hyper.Syntax.Row compare :: RowExtend key val rest h -> RowExtend key val rest h -> Ordering # (<) :: RowExtend key val rest h -> RowExtend key val rest h -> Bool # (<=) :: RowExtend key val rest h -> RowExtend key val rest h -> Bool # (>) :: RowExtend key val rest h -> RowExtend key val rest h -> Bool # (>=) :: RowExtend key val rest h -> RowExtend key val rest h -> Bool # max :: RowExtend key val rest h -> RowExtend key val rest h -> RowExtend key val rest h # min :: RowExtend key val rest h -> RowExtend key val rest h -> RowExtend key val rest h # | |
type HWitnessType (RowExtend key val rest) Source # | |
Defined in Hyper.Syntax.Row | |
type HNodesConstraint (RowExtend key val rest) constraint Source # | |
Defined in Hyper.Syntax.Row | |
data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) _ _1 Source # | |
Defined in Hyper.Syntax.Row data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) _ _1 where
| |
type MorphConstraint (RowExtend key val0 rest0) (RowExtend key val1 rest1) constraint Source # | |
Defined in Hyper.Syntax.Row type MorphConstraint (RowExtend key val0 rest0) (RowExtend key val1 rest1) constraint = (constraint rest0 rest1, constraint val0 val1) | |
type Rep (RowExtend key val rest h) Source # | |
Defined in Hyper.Syntax.Row type Rep (RowExtend key val rest h) = D1 ('MetaData "RowExtend" "Hyper.Syntax.Row" "hypertypes-0.2.2-9g9pX7Hb2mGI4yyssTDpOd" 'False) (C1 ('MetaCons "RowExtend" 'PrefixI 'True) (S1 ('MetaSel ('Just "_eKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 key) :*: (S1 ('MetaSel ('Just "_eVal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (h :# val)) :*: S1 ('MetaSel ('Just "_eRest") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (h :# rest))))) |
eKey :: forall key val rest h key. Lens (RowExtend key val rest h) (RowExtend key val rest h) key key Source #
eVal :: forall key val rest h val. Lens (RowExtend key val rest h) (RowExtend key val rest h) ((:#) h val) ((:#) h val) Source #
eRest :: forall key val rest h rest. Lens (RowExtend key val rest h) (RowExtend key val rest h) ((:#) h rest) ((:#) h rest) Source #
data W_RowExtend (key :: Type) (val :: HyperType) (rest :: HyperType) node where Source #
W_RowExtend_val :: W_RowExtend key val rest val | |
W_RowExtend_rest :: W_RowExtend key val rest rest |
data FlatRowExtends key val rest h Source #
FlatRowExtends | |
|
Instances
freExtends :: forall key val rest h key val. Lens (FlatRowExtends key val rest h) (FlatRowExtends key val rest h) (Map key ((:#) h val)) (Map key ((:#) h val)) Source #
freRest :: forall key val rest h rest. Lens (FlatRowExtends key val rest h) (FlatRowExtends key val rest h) ((:#) h rest) ((:#) h rest) Source #
data W_FlatRowExtends (key :: Type) (val :: HyperType) (rest :: HyperType) node where Source #
W_FlatRowExtends_val :: W_FlatRowExtends key val rest val | |
W_FlatRowExtends_rest :: W_FlatRowExtends key val rest rest |
data family MorphWitness s t :: HyperType -> HyperType -> Type Source #
Instances
data MorphWitness (ANode a) (ANode b) _ _1 Source # | |
Defined in Hyper.Combinator.ANode | |
data MorphWitness (App expr0) (App expr1) _ _1 Source # | |
Defined in Hyper.Syntax.App data MorphWitness (App expr0) (App expr1) _ _1 where
| |
data MorphWitness (FuncType typ0) (FuncType typ1) _ _1 Source # | |
Defined in Hyper.Syntax.FuncType data MorphWitness (FuncType typ0) (FuncType typ1) _ _1 where
| |
data MorphWitness (Lam v expr0) (Lam v expr1) _ _1 Source # | |
Defined in Hyper.Syntax.Lam data MorphWitness (Lam v expr0) (Lam v expr1) _ _1 where
| |
data MorphWitness (Let v expr0) (Let v expr1) _ _1 Source # | |
Defined in Hyper.Syntax.Let data MorphWitness (Let v expr0) (Let v expr1) _ _1 where
| |
data MorphWitness (TermMap h expr0) (TermMap h expr1) _ _1 Source # | |
Defined in Hyper.Syntax.Map data MorphWitness (TermMap h expr0) (TermMap h expr1) _ _1 where
| |
data MorphWitness (ToNom nomId term0) (ToNom nomId term1) _ _1 Source # | |
Defined in Hyper.Syntax.Nominal data MorphWitness (ToNom nomId term0) (ToNom nomId term1) _ _1 where
| |
data MorphWitness (Var v expr0) (Var v expr1) _ _1 Source # | |
Defined in Hyper.Syntax.Var | |
data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) _ _1 Source # | |
Defined in Hyper.Syntax.Row data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) _ _1 where
| |
data MorphWitness (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) _ _1 Source # | |
Defined in Hyper.Syntax.TypedLam data MorphWitness (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) _ _1 where
|
flattenRow :: (Ord key, Monad m) => ((v # rest) -> m (Maybe (RowExtend key val rest # v))) -> (v # rest) -> m (FlatRowExtends key val rest # v) Source #
flattenRowExtend :: (Ord key, Monad m) => ((v # rest) -> m (Maybe (RowExtend key val rest # v))) -> (RowExtend key val rest # v) -> m (FlatRowExtends key val rest # v) Source #
unflattenRow :: Monad m => ((RowExtend key val rest # v) -> m (v # rest)) -> (FlatRowExtends key val rest # v) -> m (v # rest) Source #
verifyRowExtendConstraints :: RowConstraints (TypeConstraintsOf rowTyp) => (TypeConstraintsOf rowTyp -> TypeConstraintsOf valTyp) -> TypeConstraintsOf rowTyp -> (RowExtend (RowKey rowTyp) valTyp rowTyp # h) -> Maybe (RowExtend (RowKey rowTyp) valTyp rowTyp # WithConstraint h) Source #
rowExtendStructureMismatch :: Ord key => (Unify m rowTyp, Unify m valTyp) => (forall c. Unify m c => (UVarOf m # c) -> (UVarOf m # c) -> m (UVarOf m # c)) -> Prism' (rowTyp # UVarOf m) (RowExtend key valTyp rowTyp # UVarOf m) -> (RowExtend key valTyp rowTyp # UVarOf m) -> (RowExtend key valTyp rowTyp # UVarOf m) -> m () Source #