Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- ctorNameToAnn :: forall ctor. (KnownSymbol ctor, HasCallStack) => FieldAnn
- ctorNameToEp :: forall ctor. (KnownSymbol ctor, HasCallStack) => EpName
- type family CanHaveEntrypoints (p :: Type) :: Bool where ...
- newtype ShouldHaveEntrypoints a = ShouldHaveEntrypoints {
- unHasEntrypoints :: a
- type family RequireSumType (a :: Type) :: Constraint where ...
Documentation
ctorNameToAnn :: forall ctor. (KnownSymbol ctor, HasCallStack) => FieldAnn Source #
ctorNameToEp :: forall ctor. (KnownSymbol ctor, HasCallStack) => EpName Source #
type family CanHaveEntrypoints (p :: Type) :: Bool where ... Source #
Used to understand whether a type can potentially declare any entrypoints.
CanHaveEntrypoints (ShouldHaveEntrypoints _) = 'True | |
CanHaveEntrypoints p = CanHaveEntrypointsT (ToT p) |
newtype ShouldHaveEntrypoints a Source #
A special type which wraps over a primitive type and states that it has entrypoints (one).
Assuming that any type can have entrypoints makes use of Lorentz entrypoints too annoying, so for declaring entrypoints for not sum types we require an explicit wrapper.
Instances
type family RequireSumType (a :: Type) :: Constraint where ... Source #
Ensure that given type is a sum type.
This helps to prevent attempts to apply a function to, for instance, a pair.
RequireSumType a = If (CanHaveEntrypoints a) (() :: Constraint) (TypeError ('Text "Expected Michelson sum type" :$$: (('Text "In type `" :<>: 'ShowType a) :<>: 'Text "`"))) |