Safe Haskell | None |
---|---|
Language | Haskell2010 |
Michelson view.
Synopsis
- newtype ViewName where
- UnsafeViewName {
- unViewName :: Text
- pattern ViewName :: Text -> ViewName
- UnsafeViewName {
- mkViewName :: Text -> Either BadViewNameError ViewName
- unsafeMkViewName :: HasCallStack => Text -> ViewName
- data BadViewNameError
- isValidViewNameChar :: Char -> Bool
- viewNameMaxLength :: Int
- renderViewName :: ViewName -> Doc
- viewNameToMText :: ViewName -> MText
- data View' op = View {
- viewName :: ViewName
- viewArgument :: Ty
- viewReturn :: Ty
- viewCode :: [op]
Documentation
Name of the view.
- It must not exceed 31 chars length;
- Must use [a-zA-Z0-9_.%@] charset.
Instances
mkViewName :: Text -> Either BadViewNameError ViewName Source #
Construct ViewName
performing all the checks.
unsafeMkViewName :: HasCallStack => Text -> ViewName Source #
Unsafe constructor for ViewName
.
data BadViewNameError Source #
Instances
isValidViewNameChar :: Char -> Bool Source #
Whether the given character is valid for a view.
viewNameMaxLength :: Int Source #
Maximum allowed name length for a view.
renderViewName :: ViewName -> Doc Source #
viewNameToMText :: ViewName -> MText Source #
Valid view names form a subset of valid Michelson texts.
Untyped view in a contract.
View | |
|
Instances
Functor View' Source # | |
Eq op => Eq (View' op) Source # | |
Data op => Data (View' op) Source # | |
Defined in Morley.Michelson.Untyped.View gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> View' op -> c (View' op) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (View' op) # toConstr :: View' op -> Constr # dataTypeOf :: View' op -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (View' op)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (View' op)) # gmapT :: (forall b. Data b => b -> b) -> View' op -> View' op # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> View' op -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> View' op -> r # gmapQ :: (forall d. Data d => d -> u) -> View' op -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> View' op -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> View' op -> m (View' op) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> View' op -> m (View' op) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> View' op -> m (View' op) # | |
Show op => Show (View' op) Source # | |
Generic (View' op) Source # | |
ToJSON op => ToJSON (View' op) Source # | |
Defined in Morley.Michelson.Untyped.View | |
FromJSON op => FromJSON (View' op) Source # | |
NFData op => NFData (View' op) Source # | |
Defined in Morley.Michelson.Untyped.View | |
type Rep (View' op) Source # | |
Defined in Morley.Michelson.Untyped.View type Rep (View' op) = D1 ('MetaData "View'" "Morley.Michelson.Untyped.View" "morley-1.16.2-inplace" 'False) (C1 ('MetaCons "View" 'PrefixI 'True) ((S1 ('MetaSel ('Just "viewName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ViewName) :*: S1 ('MetaSel ('Just "viewArgument") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty)) :*: (S1 ('MetaSel ('Just "viewReturn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Ty) :*: S1 ('MetaSel ('Just "viewCode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [op])))) |