Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Expression that carries the same extra data for all Exp
constructors.
Synopsis
- expAllExtraL :: forall x2 x1 meta2 meta1. (ExpExtrasConstrained (IsEq meta1) x1, ExpExtrasConstrained (IsEq meta2) x2) => Traversal (XExp x1) (XExp x2) meta1 meta2 -> Traversal (Exp x1) (Exp x2) meta1 meta2
- data WithMeta (meta :: Type) :: ExpExtensionDescriptorKind
- type ExpressionWithMeta meta = Exp (WithMeta meta)
- expMetaL :: Lens' (Exp (WithMeta meta)) meta
- expAnnotate :: Expression -> ExpressionWithMeta ()
- expAllMetaL :: forall x2 x1 meta2 meta1. (ExpExtrasConstrained (IsEq meta1) x1, ExpExtrasConstrained (IsEq meta2) x2) => Traversal (ExpressionWithMeta meta1) (ExpressionWithMeta meta2) meta1 meta2
- class a ~ b => IsEq a b
General case
expAllExtraL :: forall x2 x1 meta2 meta1. (ExpExtrasConstrained (IsEq meta1) x1, ExpExtrasConstrained (IsEq meta2) x2) => Traversal (XExp x1) (XExp x2) meta1 meta2 -> Traversal (Exp x1) (Exp x2) meta1 meta2 Source #
Traversal that visits all the extra fields (XExpInt
and others)
in DFS order assuming they are the same for every constructor.
It is generic enough to work not only with ExpressionWithMeta
, but
with any Exp
that has all the extra fields of the same type;
hence, this traversal is applicable to Expression
too.
This also supports additional constructors. Use devoid
if you have none.
Moreover, when used as setter, it can change the type of meta.
Custom extra field, no extra constructors
data WithMeta (meta :: Type) :: ExpExtensionDescriptorKind Source #
Expression that has the same type of metadata attached to each of its constructors.
Instances
ExpExtensionDescriptor (WithMeta m) Source # | |
type XExp (WithMeta m) Source # | |
Defined in Morley.Micheline.Expression.WithMeta | |
type XExpBytes (WithMeta m) Source # | |
Defined in Morley.Micheline.Expression.WithMeta | |
type XExpInt (WithMeta m) Source # | |
Defined in Morley.Micheline.Expression.WithMeta | |
type XExpPrim (WithMeta m) Source # | |
Defined in Morley.Micheline.Expression.WithMeta | |
type XExpSeq (WithMeta m) Source # | |
Defined in Morley.Micheline.Expression.WithMeta | |
type XExpString (WithMeta m) Source # | |
Defined in Morley.Micheline.Expression.WithMeta |
type ExpressionWithMeta meta = Exp (WithMeta meta) Source #
Alias for expression with given meta.
expAnnotate :: Expression -> ExpressionWithMeta () Source #
Lift plain Expression
to ExpressionWithMeta
.
expAllMetaL :: forall x2 x1 meta2 meta1. (ExpExtrasConstrained (IsEq meta1) x1, ExpExtrasConstrained (IsEq meta2) x2) => Traversal (ExpressionWithMeta meta1) (ExpressionWithMeta meta2) meta1 meta2 Source #
Traversal that visits all the metas in DFS order.
This is a specialization of expAllExtraL
.
This is pretty similar to expMetaL
, but picks meta of all the
transitive children.
When used as setter, it can change the type of meta.