typst-0.10: 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 :: [Sym] -> 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 Source #

Constructors

One ValType |
Many ValType |

#### Instances

Instances details

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

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

Create element function with names for positional parameters.

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

Create element function with names for positional parameters.

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

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

makeSymbolMap :: [Sym] -> Map Identifier Symbol Source #

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

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

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

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