Safe Haskell | None |
---|---|
Language | Haskell2010 |
Referenced-by-type versions of some instructions.
They allow to "dip" into stack or copy elements of stack referring them
by type. Their use is justified, because in most cases there is only
one element of each type of stack, and in cases when this does not hold
(e.g. entrypoint with multiple parameters of the same type), it might be
a good idea to wrap those types into a newtype or to use primitives from
named
package.
This module is experimental, i.e. everything here should work but may be removed in favor of better development practices.
Each instruction is followed with usage example.
Documentation
dupT :: forall a st. DupT st a st => st :-> (a ': st) Source #
Duplicate an element of stack referring it by type.
If stack contains multiple entries of this type, compile error is raised.