Safe Haskell | None |
---|---|
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 k = RowExtend {}
- eKey :: forall key val rest k key. Lens (RowExtend key val rest k) (RowExtend key val rest k) key key
- eVal :: forall key val rest k val. Lens (RowExtend key val rest k) (RowExtend key val rest k) ((#) k val) ((#) k val)
- eRest :: forall key val rest k rest. Lens (RowExtend key val rest k) (RowExtend key val rest k) ((#) k rest) ((#) k rest)
- data family KWitness k :: (Knot -> Type) -> Type
- data FlatRowExtends key val rest k = FlatRowExtends {
- _freExtends :: Map key (k # val)
- _freRest :: k # rest
- freExtends :: forall key val rest k key val. Lens (FlatRowExtends key val rest k) (FlatRowExtends key val rest k) (Map key ((#) k val)) (Map key ((#) k val))
- freRest :: forall key val rest k rest. Lens (FlatRowExtends key val rest k) (FlatRowExtends key val rest k) ((#) k rest) ((#) k rest)
- flattenRow :: (Ord key, Monad m) => (Tree v rest -> m (Maybe (Tree (RowExtend key val rest) v))) -> Tree v rest -> m (Tree (FlatRowExtends key val rest) v)
- flattenRowExtend :: (Ord key, Monad m) => (Tree v rest -> m (Maybe (Tree (RowExtend key val rest) v))) -> Tree (RowExtend key val rest) v -> m (Tree (FlatRowExtends key val rest) v)
- unflattenRow :: Monad m => (Tree (RowExtend key val rest) v -> m (Tree v rest)) -> Tree (FlatRowExtends key val rest) v -> m (Tree v rest)
- verifyRowExtendConstraints :: RowConstraints (TypeConstraintsOf rowTyp) => (TypeConstraintsOf rowTyp -> TypeConstraintsOf valTyp) -> TypeConstraintsOf rowTyp -> Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) k -> Maybe (Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) (WithConstraint k))
- rowExtendStructureMismatch :: Ord key => (Unify m rowTyp, Unify m valTyp) => (forall c. Unify m c => Tree (UVarOf m) c -> Tree (UVarOf m) c -> m (Tree (UVarOf m) c)) -> Prism' (Tree rowTyp (UVarOf m)) (Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> (TypeConstraintsOf rowTyp, Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> (TypeConstraintsOf rowTyp, Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> m ()
- rowElementInfer :: (Unify m valTyp, Unify m rowTyp, RowConstraints (TypeConstraintsOf rowTyp)) => (Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) (UVarOf m) -> Tree rowTyp (UVarOf m)) -> RowKey rowTyp -> m (Tree (UVarOf m) valTyp, Tree (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 k Source #
Row-extend primitive for use in both value-level and type-level
Instances
KNodes (RowExtend key val rest) Source # | |
Defined in AST.Term.Row type KNodesConstraint (RowExtend key val rest) c :: Constraint Source # kLiftConstraint :: KNodesConstraint (RowExtend key val rest) c => KWitness (RowExtend key val rest) n -> Proxy c -> (c n -> r) -> r Source # | |
Monoid key => KPointed (RowExtend key val rest) Source # | |
KFunctor (RowExtend key val rest) Source # | |
Semigroup key => KApply (RowExtend key val rest) Source # | |
KFoldable (RowExtend key val rest) Source # | |
KTraversable (RowExtend key val rest) Source # | |
Defined in AST.Term.Row sequenceK :: Applicative f => Tree (RowExtend key val rest) (ContainedK f p) -> f (Tree (RowExtend key val rest) p) Source # | |
Eq key => ZipMatch (RowExtend key val rest) Source # | |
Constraints (RowExtend key val rest k) Eq => Eq (RowExtend key val rest k) Source # | |
Constraints (RowExtend key val rest k) Ord => Ord (RowExtend key val rest k) Source # | |
Defined in AST.Term.Row compare :: RowExtend key val rest k -> RowExtend key val rest k -> Ordering # (<) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool # (<=) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool # (>) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool # (>=) :: RowExtend key val rest k -> RowExtend key val rest k -> Bool # max :: RowExtend key val rest k -> RowExtend key val rest k -> RowExtend key val rest k # min :: RowExtend key val rest k -> RowExtend key val rest k -> RowExtend key val rest k # | |
Constraints (RowExtend key val rest k) Show => Show (RowExtend key val rest k) Source # | |
Generic (RowExtend key val rest k) Source # | |
Constraints (RowExtend key val rest k) Binary => Binary (RowExtend key val rest k) Source # | |
Constraints (RowExtend key val rest k) NFData => NFData (RowExtend key val rest k) Source # | |
Defined in AST.Term.Row | |
data KWitness (RowExtend key val rest) node Source # | |
Defined in AST.Term.Row | |
type KNodesConstraint (RowExtend key val rest) constraint Source # | |
Defined in AST.Term.Row | |
type Rep (RowExtend key val rest k) Source # | |
Defined in AST.Term.Row type Rep (RowExtend key val rest k) = D1 (MetaData "RowExtend" "AST.Term.Row" "syntax-tree-0.1.0.0-8tfou50n4eQ4Iq1dis9DWN" False) (C1 (MetaCons "RowExtend" PrefixI True) (S1 (MetaSel (Just "_eKey") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 key) :*: (S1 (MetaSel (Just "_eVal") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # val)) :*: S1 (MetaSel (Just "_eRest") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # rest))))) |
eKey :: forall key val rest k key. Lens (RowExtend key val rest k) (RowExtend key val rest k) key key Source #
eVal :: forall key val rest k val. Lens (RowExtend key val rest k) (RowExtend key val rest k) ((#) k val) ((#) k val) Source #
eRest :: forall key val rest k rest. Lens (RowExtend key val rest k) (RowExtend key val rest k) ((#) k rest) ((#) k rest) Source #
data family KWitness k :: (Knot -> Type) -> Type Source #
KWitness k n
is a witness that n
is a node of k
Instances
data FlatRowExtends key val rest k Source #
FlatRowExtends | |
|
Instances
KNodes (FlatRowExtends key val rest) Source # | |
Defined in AST.Term.Row type KNodesConstraint (FlatRowExtends key val rest) c :: Constraint Source # data KWitness (FlatRowExtends key val rest) a :: Type Source # kLiftConstraint :: KNodesConstraint (FlatRowExtends key val rest) c => KWitness (FlatRowExtends key val rest) n -> Proxy c -> (c n -> r) -> r Source # | |
Applicative (Map key) => KPointed (FlatRowExtends key val rest) Source # | |
Defined in AST.Term.Row pureK :: (forall (n :: Knot -> Type). KWitness (FlatRowExtends key val rest) n -> Tree p n) -> Tree (FlatRowExtends key val rest) p Source # | |
KFunctor (FlatRowExtends key val rest) Source # | |
Defined in AST.Term.Row mapK :: (forall (n :: Knot -> Type). KWitness (FlatRowExtends key val rest) n -> Tree p n -> Tree q n) -> Tree (FlatRowExtends key val rest) p -> Tree (FlatRowExtends key val rest) q Source # | |
Applicative (Map key) => KApply (FlatRowExtends key val rest) Source # | |
Defined in AST.Term.Row zipK :: Tree (FlatRowExtends key val rest) p -> Tree (FlatRowExtends key val rest) q -> Tree (FlatRowExtends key val rest) (Product p q) Source # | |
KFoldable (FlatRowExtends key val rest) Source # | |
Defined in AST.Term.Row | |
KTraversable (FlatRowExtends key val rest) Source # | |
Defined in AST.Term.Row sequenceK :: Applicative f => Tree (FlatRowExtends key val rest) (ContainedK f p) -> f (Tree (FlatRowExtends key val rest) p) Source # | |
Constraints (FlatRowExtends key val rest k) Eq => Eq (FlatRowExtends key val rest k) Source # | |
Defined in AST.Term.Row (==) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool # (/=) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool # | |
Constraints (FlatRowExtends key val rest k) Ord => Ord (FlatRowExtends key val rest k) Source # | |
Defined in AST.Term.Row compare :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Ordering # (<) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool # (<=) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool # (>) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool # (>=) :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> Bool # max :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> FlatRowExtends key val rest k # min :: FlatRowExtends key val rest k -> FlatRowExtends key val rest k -> FlatRowExtends key val rest k # | |
Constraints (FlatRowExtends key val rest k) Show => Show (FlatRowExtends key val rest k) Source # | |
Defined in AST.Term.Row showsPrec :: Int -> FlatRowExtends key val rest k -> ShowS # show :: FlatRowExtends key val rest k -> String # showList :: [FlatRowExtends key val rest k] -> ShowS # | |
Generic (FlatRowExtends key val rest k) Source # | |
Defined in AST.Term.Row type Rep (FlatRowExtends key val rest k) :: Type -> Type # from :: FlatRowExtends key val rest k -> Rep (FlatRowExtends key val rest k) x # to :: Rep (FlatRowExtends key val rest k) x -> FlatRowExtends key val rest k # | |
Constraints (FlatRowExtends key val rest k) Binary => Binary (FlatRowExtends key val rest k) Source # | |
Defined in AST.Term.Row put :: FlatRowExtends key val rest k -> Put # get :: Get (FlatRowExtends key val rest k) # putList :: [FlatRowExtends key val rest k] -> Put # | |
Constraints (FlatRowExtends key val rest k) NFData => NFData (FlatRowExtends key val rest k) Source # | |
Defined in AST.Term.Row rnf :: FlatRowExtends key val rest k -> () # | |
data KWitness (FlatRowExtends key val rest) node Source # | |
Defined in AST.Term.Row data KWitness (FlatRowExtends key val rest) node where
| |
type KNodesConstraint (FlatRowExtends key val rest) constraint Source # | |
Defined in AST.Term.Row | |
type Rep (FlatRowExtends key val rest k) Source # | |
Defined in AST.Term.Row type Rep (FlatRowExtends key val rest k) = D1 (MetaData "FlatRowExtends" "AST.Term.Row" "syntax-tree-0.1.0.0-8tfou50n4eQ4Iq1dis9DWN" False) (C1 (MetaCons "FlatRowExtends" PrefixI True) (S1 (MetaSel (Just "_freExtends") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map key (k # val))) :*: S1 (MetaSel (Just "_freRest") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (k # rest)))) |
freExtends :: forall key val rest k key val. Lens (FlatRowExtends key val rest k) (FlatRowExtends key val rest k) (Map key ((#) k val)) (Map key ((#) k val)) Source #
freRest :: forall key val rest k rest. Lens (FlatRowExtends key val rest k) (FlatRowExtends key val rest k) ((#) k rest) ((#) k rest) Source #
flattenRow :: (Ord key, Monad m) => (Tree v rest -> m (Maybe (Tree (RowExtend key val rest) v))) -> Tree v rest -> m (Tree (FlatRowExtends key val rest) v) Source #
flattenRowExtend :: (Ord key, Monad m) => (Tree v rest -> m (Maybe (Tree (RowExtend key val rest) v))) -> Tree (RowExtend key val rest) v -> m (Tree (FlatRowExtends key val rest) v) Source #
unflattenRow :: Monad m => (Tree (RowExtend key val rest) v -> m (Tree v rest)) -> Tree (FlatRowExtends key val rest) v -> m (Tree v rest) Source #
verifyRowExtendConstraints :: RowConstraints (TypeConstraintsOf rowTyp) => (TypeConstraintsOf rowTyp -> TypeConstraintsOf valTyp) -> TypeConstraintsOf rowTyp -> Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) k -> Maybe (Tree (RowExtend (RowKey rowTyp) valTyp rowTyp) (WithConstraint k)) Source #
rowExtendStructureMismatch :: Ord key => (Unify m rowTyp, Unify m valTyp) => (forall c. Unify m c => Tree (UVarOf m) c -> Tree (UVarOf m) c -> m (Tree (UVarOf m) c)) -> Prism' (Tree rowTyp (UVarOf m)) (Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> (TypeConstraintsOf rowTyp, Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> (TypeConstraintsOf rowTyp, Tree (RowExtend key valTyp rowTyp) (UVarOf m)) -> m () Source #