Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Michelson view.
Synopsis
- newtype ViewName where
- UnsafeViewName {
- unViewName :: Text
- pattern ViewName :: Text -> ViewName
- UnsafeViewName {
- mkViewName :: Text -> Either BadViewNameError 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
- newtype ViewsSet instr = ViewsSet {
- unViewsSet :: Map ViewName (View' instr)
- mkViewsSet :: [View' instr] -> Either ViewsSetError (ViewsSet instr)
- data ViewsSetError = DuplicatedViewName ViewName
- emptyViewsSet :: forall instr. ViewsSet instr
- addViewToSet :: View' instr -> ViewsSet instr -> Either ViewsSetError (ViewsSet instr)
- lookupView :: forall instr. ViewName -> ViewsSet instr -> Maybe (View' instr)
- viewsSetNames :: forall instr. ViewsSet instr -> Set ViewName
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.
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 # | |
FromJSON op => FromJSON (View' op) Source # | |
ToJSON op => ToJSON (View' op) Source # | |
Defined in Morley.Michelson.Untyped.View | |
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) # | |
Generic (View' op) Source # | |
Show op => Show (View' op) Source # | |
NFData op => NFData (View' op) Source # | |
Defined in Morley.Michelson.Untyped.View | |
Eq op => Eq (View' op) Source # | |
type Rep (View' op) Source # | |
Defined in Morley.Michelson.Untyped.View type Rep (View' op) = D1 ('MetaData "View'" "Morley.Michelson.Untyped.View" "morley-1.20.0-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)))) |
newtype ViewsSet instr Source #
ViewsSet | |
|
Instances
Functor ViewsSet Source # | |
FromJSON instr => FromJSON (ViewsSet instr) Source # | |
ToJSON instr => ToJSON (ViewsSet instr) Source # | |
Defined in Morley.Michelson.Untyped.View | |
Data instr => Data (ViewsSet instr) Source # | |
Defined in Morley.Michelson.Untyped.View gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ViewsSet instr -> c (ViewsSet instr) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ViewsSet instr) # toConstr :: ViewsSet instr -> Constr # dataTypeOf :: ViewsSet instr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ViewsSet instr)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ViewsSet instr)) # gmapT :: (forall b. Data b => b -> b) -> ViewsSet instr -> ViewsSet instr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ViewsSet instr -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ViewsSet instr -> r # gmapQ :: (forall d. Data d => d -> u) -> ViewsSet instr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ViewsSet instr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ViewsSet instr -> m (ViewsSet instr) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewsSet instr -> m (ViewsSet instr) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ViewsSet instr -> m (ViewsSet instr) # | |
Show instr => Show (ViewsSet instr) Source # | |
Default (ViewsSet instr) Source # | |
Defined in Morley.Michelson.Untyped.View | |
NFData instr => NFData (ViewsSet instr) Source # | |
Defined in Morley.Michelson.Untyped.View | |
Eq instr => Eq (ViewsSet instr) Source # | |
Container (ViewsSet instr) Source # | |
Defined in Morley.Michelson.Untyped.View toList :: ViewsSet instr -> [Element (ViewsSet instr)] # null :: ViewsSet instr -> Bool # foldr :: (Element (ViewsSet instr) -> b -> b) -> b -> ViewsSet instr -> b # foldl :: (b -> Element (ViewsSet instr) -> b) -> b -> ViewsSet instr -> b # foldl' :: (b -> Element (ViewsSet instr) -> b) -> b -> ViewsSet instr -> b # length :: ViewsSet instr -> Int # elem :: Element (ViewsSet instr) -> ViewsSet instr -> Bool # foldMap :: Monoid m => (Element (ViewsSet instr) -> m) -> ViewsSet instr -> m # fold :: ViewsSet instr -> Element (ViewsSet instr) # foldr' :: (Element (ViewsSet instr) -> b -> b) -> b -> ViewsSet instr -> b # notElem :: Element (ViewsSet instr) -> ViewsSet instr -> Bool # all :: (Element (ViewsSet instr) -> Bool) -> ViewsSet instr -> Bool # any :: (Element (ViewsSet instr) -> Bool) -> ViewsSet instr -> Bool # and :: ViewsSet instr -> Bool # or :: ViewsSet instr -> Bool # find :: (Element (ViewsSet instr) -> Bool) -> ViewsSet instr -> Maybe (Element (ViewsSet instr)) # safeHead :: ViewsSet instr -> Maybe (Element (ViewsSet instr)) # safeMaximum :: ViewsSet instr -> Maybe (Element (ViewsSet instr)) # safeMinimum :: ViewsSet instr -> Maybe (Element (ViewsSet instr)) # safeFoldr1 :: (Element (ViewsSet instr) -> Element (ViewsSet instr) -> Element (ViewsSet instr)) -> ViewsSet instr -> Maybe (Element (ViewsSet instr)) # safeFoldl1 :: (Element (ViewsSet instr) -> Element (ViewsSet instr) -> Element (ViewsSet instr)) -> ViewsSet instr -> Maybe (Element (ViewsSet instr)) # | |
type Element (ViewsSet instr) Source # | |
mkViewsSet :: [View' instr] -> Either ViewsSetError (ViewsSet instr) Source #
data ViewsSetError Source #
Errors possible when constructing ViewsSet
.
Instances
Show ViewsSetError Source # | |
Defined in Morley.Michelson.Internal.ViewsSet showsPrec :: Int -> ViewsSetError -> ShowS # show :: ViewsSetError -> String # showList :: [ViewsSetError] -> ShowS # | |
Eq ViewsSetError Source # | |
Defined in Morley.Michelson.Internal.ViewsSet (==) :: ViewsSetError -> ViewsSetError -> Bool # (/=) :: ViewsSetError -> ViewsSetError -> Bool # | |
Buildable ViewsSetError Source # | |
Defined in Morley.Michelson.Internal.ViewsSet build :: ViewsSetError -> Doc buildList :: [ViewsSetError] -> Doc |
Manipulation
emptyViewsSet :: forall instr. ViewsSet instr Source #
addViewToSet :: View' instr -> ViewsSet instr -> Either ViewsSetError (ViewsSet instr) Source #