typst-0.6.2: Parsing and evaluating typst syntax.

Safe Haskell | None
Language | Haskell2010

Typst.Util

Synopsis

- data TypeSpec
  - = One ValType
  - | Many ValType
- makeElement :: Maybe Identifier -> Identifier -> [(Identifier, TypeSpec)] -> (Identifier, Val)
- makeElementWithScope :: Maybe Identifier -> Identifier -> [(Identifier, TypeSpec)] -> Map Identifier Val -> (Identifier, Val)
- makeFunction :: (forall (m' :: Type -> Type). Monad m' => ReaderT Arguments (MP m') Val) -> Val
- makeFunctionWithScope :: (forall (m' :: Type -> Type). Monad m' => ReaderT Arguments (MP m') Val) -> Map Identifier Val -> Val
- makeSymbolMap :: [(Text, Bool, Text)] -> Map Identifier Symbol
- argsToFields :: MonadFail m => [(Identifier, TypeSpec)] -> Arguments -> m (Map Identifier Val)
- nthArg :: forall (m :: Type -> Type) a. (Monad m, FromVal a) => Int -> ReaderT Arguments (MP m) a
- namedArg :: forall (m :: Type -> Type) a. (Monad m, FromVal a) => Identifier -> a -> ReaderT Arguments (MP m) a
- allArgs :: forall (m :: Type -> Type). Monad m => ReaderT Arguments (MP m) [Val]

# Documentation

data TypeSpec #

Constructors

One ValType |
Many ValType |

#### Instances

Instances details

Show TypeSpec # |
Instance details Defined in Typst.Util Methods showsPrec :: Int -> TypeSpec -> ShowS # show :: TypeSpec -> String # showList :: [TypeSpec] -> ShowS #
Eq TypeSpec # |
Instance details Defined in Typst.Util Methods (==) :: TypeSpec -> TypeSpec -> Bool # (/=) :: TypeSpec -> TypeSpec -> Bool #

makeElement :: Maybe Identifier -> Identifier -> [(Identifier, TypeSpec)] -> (Identifier, Val) #

Create element function with names for positional parameters.

makeElementWithScope :: Maybe Identifier -> Identifier -> [(Identifier, TypeSpec)] -> Map Identifier Val -> (Identifier, Val) #

Create element function with names for positional parameters.

makeFunction :: (forall (m' :: Type -> Type). Monad m' => ReaderT Arguments (MP m') Val) -> Val #

makeFunctionWithScope :: (forall (m' :: Type -> Type). Monad m' => ReaderT Arguments (MP m') Val) -> Map Identifier Val -> Val #

makeSymbolMap :: [(Text, Bool, Text)] -> Map Identifier Symbol #

argsToFields :: MonadFail m => [(Identifier, TypeSpec)] -> Arguments -> m (Map Identifier Val) #

nthArg :: forall (m :: Type -> Type) a. (Monad m, FromVal a) => Int -> ReaderT Arguments (MP m) a #

namedArg :: forall (m :: Type -> Type) a. (Monad m, FromVal a) => Identifier -> a -> ReaderT Arguments (MP m) a #

allArgs :: forall (m :: Type -> Type). Monad m => ReaderT Arguments (MP m) [Val] #