Typst.Types

typst-0.8.0.1: Parsing and evaluating typst syntax.

Safe Haskell | None
Language | Haskell2010

Typst.Types

Synopsis

- data RE
- data Val
  - = VNone
  - | VAuto
  - | VBoolean !Bool
  - | VInteger !Integer
  - | VFloat !Double
  - | VRatio !Rational
  - | VLength !Length
  - | VAlignment (Maybe Horiz) (Maybe Vert)
  - | VAngle !Double
  - | VFraction !Double
  - | VColor !Color
  - | VSymbol !Symbol
  - | VString !Text
  - | VRegex !RE
  - | VDateTime (Maybe Day) (Maybe DiffTime)
  - | VContent (Seq Content)
  - | VArray (Vector Val)
  - | VDict (OMap Identifier Val)
  - | VTermItem (Seq Content) (Seq Content)
  - | VDirection Direction
  - | VFunction (Maybe Identifier) (Map Identifier Val) Function
  - | VArguments Arguments
  - | VLabel !Text
  - | VCounter !Counter
  - | VSelector !Selector
  - | VModule Identifier (Map Identifier Val)
  - | VStyles
  - | VVersion [Integer]
  - | VBytes ByteString
  - | VType !ValType
- data ValType
  - = TNone
  - | TAuto
  - | TBoolean
  - | TInteger
  - | TFloat
  - | TRatio
  - | TLength
  - | TAlignment
  - | TAngle
  - | TFraction
  - | TColor
  - | TSymbol
  - | TString
  - | TRegex
  - | TDateTime
  - | TContent
  - | TArray
  - | TDict
  - | TTermItem
  - | TDirection
  - | TFunction
  - | TArguments
  - | TModule
  - | TSelector
  - | TStyles
  - | TLabel
  - | TCounter
  - | TLocation
  - | TVersion
  - | TBytes
  - | TType
  - | TAny
  - | ValType :|: ValType
- valType :: Val -> ValType
- hasType :: ValType -> Val -> Bool
- class FromVal a where
  - fromVal :: (MonadPlus m, MonadFail m) => Val -> m a
- class Negatable a where
  - maybeNegate :: a -> Maybe a
- class Negatable a => Summable a where
  - maybePlus :: a -> a -> Maybe a
  - maybeMinus :: a -> a -> Maybe a
- class Multipliable a where
  - maybeTimes :: a -> a -> Maybe a
  - maybeDividedBy :: a -> a -> Maybe a
- data Selector
  - = SelectElement Identifier [(Identifier, Val)]
  - | SelectString !Text
  - | SelectRegex !RE
  - | SelectLabel !Text
  - | SelectOr Selector Selector
  - | SelectAnd Selector Selector
  - | SelectBefore Selector Selector
  - | SelectAfter Selector Selector
- data Symbol = Symbol {
  - symDefault :: !Text
  - symAccent :: !Bool
  - symVariants :: [(Set Text, Text)]
  }
- data Content
  - = Txt !Text
  - | Lab !Text
  - | Elt {
    - eltName :: Identifier
    - eltPos :: Maybe SourcePos
    - eltFields :: Map Identifier Val
    }
- newtype Function = Function (forall (m :: Type -> Type). Monad m => Arguments -> MP m Val)
- data Arguments = Arguments {
  - positional :: [Val]
  - named :: OMap Identifier Val
  }
- getPositionalArg :: (MonadFail m, MonadPlus m, FromVal a) => Int -> Arguments -> m a
- getNamedArg :: (MonadFail m, MonadPlus m, FromVal a) => Identifier -> Arguments -> m a
- class Compare a where
  - comp :: a -> a -> Maybe Ordering
- type MP (m :: Type -> Type) = ParsecT [Markup] (EvalState m) m
- data Scope
  - = FunctionScope
  - | BlockScope
- data FlowDirective
  - = FlowNormal
  - | FlowBreak
  - | FlowContinue
  - | FlowReturn Bool
- data Operations (m :: Type -> Type) = Operations {
  - loadBytes :: FilePath -> m ByteString
  - currentUTCTime :: m UTCTime
  - lookupEnvVar :: String -> m (Maybe String)
  - checkExistence :: FilePath -> m Bool
  }
- data XdgDirectory
  - = XdgData
  - | XdgConfig
  - | XdgCache
  - | XdgState
- data EvalState (m :: Type -> Type) = EvalState {
  - evalIdentifiers :: [(Scope, Map Identifier Val)]
  - evalStandardIdentifiers :: [(Scope, Map Identifier Val)]
  - evalMathIdentifiers :: [(Scope, Map Identifier Val)]
  - evalCounters :: Map Counter Integer
  - evalMath :: Bool
  - evalShowRules :: [ShowRule]
  - evalNextShowRuleIdentifier :: Int
  - evalStyles :: Map Identifier Arguments
  - evalFlowDirective :: FlowDirective
  - evalPackageRoot :: FilePath
  - evalLocalDir :: FilePath
  - evalOperations :: Operations m
  }
- emptyEvalState :: forall (m :: Type -> Type). EvalState m
- data ShowRule = ShowRule Int Selector (forall (m :: Type -> Type). Monad m => Content -> MP m (Seq Content))
- data Counter
  - = CounterCustom !Text
  - | CounterLabel !Text
  - | CounterSelector !Selector
  - | CounterPage
- data LUnit
  - = LEm
  - | LPt
  - | LIn
  - | LCm
  - | LMm
- data Length
  - = LExact Double LUnit
  - | LRatio !Rational
  - | LSum Length Length
- renderLength :: Bool -> Length -> Text
- data Horiz
  - = HorizStart
  - | HorizEnd
  - | HorizLeft
  - | HorizCenter
  - | HorizRight
- data Vert
  - = VertTop
  - | VertHorizon
  - | VertBottom
- data Color
  - = RGB Rational Rational Rational Rational
  - | CMYK Rational Rational Rational Rational
  - | Luma Rational
- data Direction
  - = Ltr
  - | Rtl
  - | Ttb
  - | Btt
- newtype Identifier = Identifier Text
- lookupIdentifier :: forall (m :: Type -> Type). Monad m => Identifier -> MP m Val
- joinVals :: MonadFail m => Val -> Val -> m Val
- prettyVal :: Val -> Doc
- valToContent :: Val -> Seq Content
- prettyType :: ValType -> Text
- repr :: Val -> Text
- data Attempt a
  - = Success a
  - | Failure String

# Documentation

data RE #

A regular expression. Note that typst-hs does not use the same Regex engine as Typst. See issue #28.

#### Instances

Instances details

Show RE # |
Instance details Defined in Typst.Regex Methods showsPrec :: Int -> RE -> ShowS # show :: RE -> String # showList :: [RE] -> ShowS #
Eq RE # |
Instance details Defined in Typst.Regex Methods (==) :: RE -> RE -> Bool # (/=) :: RE -> RE -> Bool #
Ord RE # |
Instance details Defined in Typst.Regex Methods compare :: RE -> RE -> Ordering # (<) :: RE -> RE -> Bool # (<=) :: RE -> RE -> Bool # (>) :: RE -> RE -> Bool # (>=) :: RE -> RE -> Bool # max :: RE -> RE -> RE # min :: RE -> RE -> RE #
FromVal RE # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m RE #

data Val #

A Typst value. More documentation can be found in the Foundations chapter of the Typst reference manual. A more concise (but somewhat outdated) summary can also be found in L. Mädje "Typst: a programmable markup language for typesetting", page 32-33.

Constructors

VNone | The `none` value, indicates the absence of any other value.
VAuto | The `auto` value, used to automatically set an appropriate value.
VBoolean !Bool | A `bool` value.
VInteger !Integer | An `int` value.
VFloat !Double | A `float` value.
VRatio !Rational | A `ratio` value, a proportion of a certain whole, for example `50%`.
VLength !Length | A `length` or a `relative` value.
VAlignment (Maybe Horiz) (Maybe Vert) | An `alignment` value, indicating the alignment of some content along both the horizontal and vertical axes.
VAngle !Double | An `angle` value (expressed internally in degrees).
VFraction !Double | A `fraction` value, defining the proportions of remaing space is to be distributed, e.g. `2 fr`.
VColor !Color | A `color` value. Not all Typst color spaces are supported; only `rgb`, `cmyk`, and `luma` are available. See issue #35.
VSymbol !Symbol | A `symbol` value, representing a Unicode symbol.
VString !Text | A UTF-8 encoded text `string`.
VRegex !RE | A `regex` (regular expression). See `RE` for details.
VDateTime (Maybe Day) (Maybe DiffTime) | A `datetime` value, a date, a time, or a combination of both.
VContent (Seq Content) | A `content` value, see `Content` for more details.
VArray (Vector Val) | An `array` value, for example `(10, 20, 30)`.
VDict (OMap Identifier Val) | A `dictionary` value, for example `(a:20, b:30)`.
VTermItem (Seq Content) (Seq Content) |
VDirection Direction | A `direction` to lay out content.
VFunction (Maybe Identifier) (Map Identifier Val) Function | A Typst function.
VArguments Arguments | Positional and named function arguments
VLabel !Text | A `label` to some element, for example `hello`.
VCounter !Counter |
VSelector !Selector |
VModule Identifier (Map Identifier Val) |
VStyles |
VVersion [Integer] |
VBytes ByteString |
VType !ValType |

#### Instances

Instances details

FromJSON Val # |
Instance details Defined in Typst.Types Methods parseJSON :: Value -> Parser Val # parseJSONList :: Value -> Parser [Val] # omittedField :: Maybe Val #
Show Val # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Val -> ShowS # show :: Val -> String # showList :: [Val] -> ShowS #
Eq Val # |
Instance details Defined in Typst.Types Methods (==) :: Val -> Val -> Bool # (/=) :: Val -> Val -> Bool #
Ord Val # |
Instance details Defined in Typst.Types Methods compare :: Val -> Val -> Ordering # (<) :: Val -> Val -> Bool # (<=) :: Val -> Val -> Bool # (>) :: Val -> Val -> Bool # (>=) :: Val -> Val -> Bool # max :: Val -> Val -> Val # min :: Val -> Val -> Val #
FromValue Val # |
Instance details Defined in Typst.Types Methods fromValue :: Value' l -> Matcher l Val # listFromValue :: Value' l -> Matcher l [Val] #
Compare Val # |
Instance details Defined in Typst.Types Methods comp :: Val -> Val -> Maybe Ordering #
FromVal Val # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Val #
Multipliable Val # |
Instance details Defined in Typst.Types Methods maybeTimes :: Val -> Val -> Maybe Val # maybeDividedBy :: Val -> Val -> Maybe Val #
Negatable Val # |
Instance details Defined in Typst.Types Methods maybeNegate :: Val -> Maybe Val #
Summable Val # |
Instance details Defined in Typst.Types Methods maybePlus :: Val -> Val -> Maybe Val # maybeMinus :: Val -> Val -> Maybe Val #

data ValType #

A Typst type, see documentation for `Val`.

Constructors

TNone |
TAuto |
TBoolean |
TInteger |
TFloat |
TRatio |
TLength |
TAlignment |
TAngle |
TFraction |
TColor |
TSymbol |
TString |
TRegex |
TDateTime |
TContent |
TArray |
TDict |
TTermItem |
TDirection |
TFunction |
TArguments |
TModule |
TSelector |
TStyles |
TLabel |
TCounter |
TLocation |
TVersion |
TBytes |
TType |
TAny |
ValType :|: ValType |

#### Instances

Instances details

Show ValType # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> ValType -> ShowS # show :: ValType -> String # showList :: [ValType] -> ShowS #
Eq ValType # |
Instance details Defined in Typst.Types Methods (==) :: ValType -> ValType -> Bool # (/=) :: ValType -> ValType -> Bool #
Ord ValType # |
Instance details Defined in Typst.Types Methods compare :: ValType -> ValType -> Ordering # (<) :: ValType -> ValType -> Bool # (<=) :: ValType -> ValType -> Bool # (>) :: ValType -> ValType -> Bool # (>=) :: ValType -> ValType -> Bool # max :: ValType -> ValType -> ValType # min :: ValType -> ValType -> ValType #

valType :: Val -> ValType #

hasType :: ValType -> Val -> Bool #

class FromVal a where #

Methods

fromVal :: (MonadPlus m, MonadFail m) => Val -> m a #

#### Instances

Instances details

FromVal Rational # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Rational #
FromVal Text # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Text #
FromVal RE # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m RE #
FromVal Counter # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Counter #
FromVal Direction # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Direction #
FromVal Function # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Function #
FromVal Length # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Length #
FromVal Selector # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Selector #
FromVal Val # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Val #
FromVal Integer # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Integer #
FromVal String # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m String #
FromVal Bool # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Bool #
FromVal Double # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Double #
FromVal Int # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Int #
FromVal (Seq Content) # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m (Seq Content) #
FromVal a => FromVal (Vector a) # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m (Vector a) #
FromVal a => FromVal (Maybe a) # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m (Maybe a) #

class Negatable a where #

Methods

maybeNegate :: a -> Maybe a #

#### Instances

Instances details

Negatable Val # |
Instance details Defined in Typst.Types Methods maybeNegate :: Val -> Maybe Val #

class Negatable a => Summable a where #

Minimal complete definition

maybePlus

Methods

maybePlus :: a -> a -> Maybe a #

maybeMinus :: a -> a -> Maybe a #

#### Instances

Instances details

Summable Val # |
Instance details Defined in Typst.Types Methods maybePlus :: Val -> Val -> Maybe Val # maybeMinus :: Val -> Val -> Maybe Val #

class Multipliable a where #

Methods

maybeTimes :: a -> a -> Maybe a #

maybeDividedBy :: a -> a -> Maybe a #

#### Instances

Instances details

Multipliable Val # |
Instance details Defined in Typst.Types Methods maybeTimes :: Val -> Val -> Maybe Val # maybeDividedBy :: Val -> Val -> Maybe Val #

data Selector #

Constructors

SelectElement Identifier [(Identifier, Val)] |
SelectString !Text |
SelectRegex !RE |
SelectLabel !Text |
SelectOr Selector Selector |
SelectAnd Selector Selector |
SelectBefore Selector Selector |
SelectAfter Selector Selector |

#### Instances

Instances details

Show Selector # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Selector -> ShowS # show :: Selector -> String # showList :: [Selector] -> ShowS #
Eq Selector # |
Instance details Defined in Typst.Types Methods (==) :: Selector -> Selector -> Bool # (/=) :: Selector -> Selector -> Bool #
Ord Selector # |
Instance details Defined in Typst.Types Methods compare :: Selector -> Selector -> Ordering # (<) :: Selector -> Selector -> Bool # (<=) :: Selector -> Selector -> Bool # (>) :: Selector -> Selector -> Bool # (>=) :: Selector -> Selector -> Bool # max :: Selector -> Selector -> Selector # min :: Selector -> Selector -> Selector #
FromVal Selector # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Selector #

data Symbol #

Constructors

Symbol |
Fields symDefault :: !Text symAccent :: !Bool symVariants :: [(Set Text, Text)]

#### Instances

Instances details

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

data Content #

Constructors

Txt !Text |
Lab !Text |
Elt |
Fields eltName :: Identifier eltPos :: Maybe SourcePos eltFields :: Map Identifier Val

#### Instances

Instances details

IsString Content # |
Instance details Defined in Typst.Types Methods fromString :: String -> Content #
Show Content # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Content -> ShowS # show :: Content -> String # showList :: [Content] -> ShowS #
Eq Content # |
Instance details Defined in Typst.Types Methods (==) :: Content -> Content -> Bool # (/=) :: Content -> Content -> Bool #
Ord Content # |
Instance details Defined in Typst.Types Methods compare :: Content -> Content -> Ordering # (<) :: Content -> Content -> Bool # (<=) :: Content -> Content -> Bool # (>) :: Content -> Content -> Bool # (>=) :: Content -> Content -> Bool # max :: Content -> Content -> Content # min :: Content -> Content -> Content #
FromVal (Seq Content) # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m (Seq Content) #

newtype Function #

Constructors

Function (forall (m :: Type -> Type). Monad m => Arguments -> MP m Val) |

#### Instances

Instances details

Show Function # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Function -> ShowS # show :: Function -> String # showList :: [Function] -> ShowS #
Eq Function # |
Instance details Defined in Typst.Types Methods (==) :: Function -> Function -> Bool # (/=) :: Function -> Function -> Bool #
FromVal Function # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Function #

data Arguments #

Constructors

Arguments |
Fields positional :: [Val] named :: OMap Identifier Val

#### Instances

Instances details

Monoid Arguments # |
Instance details Defined in Typst.Types Methods mempty :: Arguments # mappend :: Arguments -> Arguments -> Arguments # mconcat :: [Arguments] -> Arguments #
Semigroup Arguments # |
Instance details Defined in Typst.Types Methods (<>) :: Arguments -> Arguments -> Arguments # sconcat :: NonEmpty Arguments -> Arguments # stimes :: Integral b => b -> Arguments -> Arguments #
Show Arguments # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Arguments -> ShowS # show :: Arguments -> String # showList :: [Arguments] -> ShowS #
Eq Arguments # |
Instance details Defined in Typst.Types Methods (==) :: Arguments -> Arguments -> Bool # (/=) :: Arguments -> Arguments -> Bool #

getPositionalArg :: (MonadFail m, MonadPlus m, FromVal a) => Int -> Arguments -> m a #

getNamedArg :: (MonadFail m, MonadPlus m, FromVal a) => Identifier -> Arguments -> m a #

class Compare a where #

Methods

comp :: a -> a -> Maybe Ordering #

#### Instances

Instances details

Compare Val # |
Instance details Defined in Typst.Types Methods comp :: Val -> Val -> Maybe Ordering #

type MP (m :: Type -> Type) = ParsecT [Markup] (EvalState m) m #

data Scope #

Constructors

FunctionScope |
BlockScope |

#### Instances

Instances details

Show Scope # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Scope -> ShowS # show :: Scope -> String # showList :: [Scope] -> ShowS #
Eq Scope # |
Instance details Defined in Typst.Types Methods (==) :: Scope -> Scope -> Bool # (/=) :: Scope -> Scope -> Bool #
Ord Scope # |
Instance details Defined in Typst.Types Methods compare :: Scope -> Scope -> Ordering # (<) :: Scope -> Scope -> Bool # (<=) :: Scope -> Scope -> Bool # (>) :: Scope -> Scope -> Bool # (>=) :: Scope -> Scope -> Bool # max :: Scope -> Scope -> Scope # min :: Scope -> Scope -> Scope #

data FlowDirective #

Constructors

FlowNormal |
FlowBreak |
FlowContinue |
FlowReturn Bool |

#### Instances

Instances details

Show FlowDirective # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> FlowDirective -> ShowS # show :: FlowDirective -> String # showList :: [FlowDirective] -> ShowS #
Eq FlowDirective # |
Instance details Defined in Typst.Types Methods (==) :: FlowDirective -> FlowDirective -> Bool # (/=) :: FlowDirective -> FlowDirective -> Bool #
Ord FlowDirective # |
Instance details Defined in Typst.Types Methods compare :: FlowDirective -> FlowDirective -> Ordering # (<) :: FlowDirective -> FlowDirective -> Bool # (<=) :: FlowDirective -> FlowDirective -> Bool # (>) :: FlowDirective -> FlowDirective -> Bool # (>=) :: FlowDirective -> FlowDirective -> Bool # max :: FlowDirective -> FlowDirective -> FlowDirective # min :: FlowDirective -> FlowDirective -> FlowDirective #

data Operations (m :: Type -> Type) #

Constructors

Operations |
Fields loadBytes :: FilePath -> m ByteString currentUTCTime :: m UTCTime lookupEnvVar :: String -> m (Maybe String) checkExistence :: FilePath -> m Bool

data XdgDirectory #

Special directories for storing user-specific application data, configuration, and cache files, as specified by the XDG Base Directory Specification.

Note: On Windows, `XdgData` and `XdgConfig` usually map to the same directory.

Since: directory-1.2.3.0

Constructors

XdgData | For data files (e.g. images). It uses the `XDG_DATA_HOME` environment variable. On non-Windows systems, the default is `~/.local/share`. On Windows, the default is `%APPDATA%` (e.g. `C:/Users/<user>/AppData/Roaming`). Can be considered as the user-specific equivalent of `/usr/share`.
XdgConfig | For configuration files. It uses the `XDG_CONFIG_HOME` environment variable. On non-Windows systems, the default is `~/.config`. On Windows, the default is `%APPDATA%` (e.g. `C:/Users/<user>/AppData/Roaming`). Can be considered as the user-specific equivalent of `/etc`.
XdgCache | For non-essential files (e.g. cache). It uses the `XDG_CACHE_HOME` environment variable. On non-Windows systems, the default is `~/.cache`. On Windows, the default is `%LOCALAPPDATA%` (e.g. `C:/Users/<user>/AppData/Local`). Can be considered as the user-specific equivalent of `/var/cache`.
XdgState | For data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in `XdgData`. It uses the `XDG_STATE_HOME` environment variable. On non-Windows sytems, the default is `~/.local/state`. On Windows, the default is `%LOCALAPPDATA%` (e.g. `C:/Users/<user>/AppData/Local`). Since: directory-1.3.7.0

#### Instances

Instances details

Bounded XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods minBound :: XdgDirectory # maxBound :: XdgDirectory #
Enum XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods succ :: XdgDirectory -> XdgDirectory # pred :: XdgDirectory -> XdgDirectory # toEnum :: Int -> XdgDirectory # fromEnum :: XdgDirectory -> Int # enumFrom :: XdgDirectory -> [XdgDirectory] # enumFromThen :: XdgDirectory -> XdgDirectory -> [XdgDirectory] # enumFromTo :: XdgDirectory -> XdgDirectory -> [XdgDirectory] # enumFromThenTo :: XdgDirectory -> XdgDirectory -> XdgDirectory -> [XdgDirectory] #
Read XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods readsPrec :: Int -> ReadS XdgDirectory # readList :: ReadS [XdgDirectory] # readPrec :: ReadPrec XdgDirectory # readListPrec :: ReadPrec [XdgDirectory] #
Show XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods showsPrec :: Int -> XdgDirectory -> ShowS # show :: XdgDirectory -> String # showList :: [XdgDirectory] -> ShowS #
Eq XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods (==) :: XdgDirectory -> XdgDirectory -> Bool # (/=) :: XdgDirectory -> XdgDirectory -> Bool #
Ord XdgDirectory |
Instance details Defined in System.Directory.Internal.Common Methods compare :: XdgDirectory -> XdgDirectory -> Ordering # (<) :: XdgDirectory -> XdgDirectory -> Bool # (<=) :: XdgDirectory -> XdgDirectory -> Bool # (>) :: XdgDirectory -> XdgDirectory -> Bool # (>=) :: XdgDirectory -> XdgDirectory -> Bool # max :: XdgDirectory -> XdgDirectory -> XdgDirectory # min :: XdgDirectory -> XdgDirectory -> XdgDirectory #

data EvalState (m :: Type -> Type) #

Constructors

EvalState |
Fields evalIdentifiers :: [(Scope, Map Identifier Val)] evalStandardIdentifiers :: [(Scope, Map Identifier Val)] evalMathIdentifiers :: [(Scope, Map Identifier Val)] evalCounters :: Map Counter Integer evalMath :: Bool evalShowRules :: [ShowRule] evalNextShowRuleIdentifier :: Int evalStyles :: Map Identifier Arguments evalFlowDirective :: FlowDirective evalPackageRoot :: FilePath evalLocalDir :: FilePath evalOperations :: Operations m

emptyEvalState :: forall (m :: Type -> Type). EvalState m #

data ShowRule #

Constructors

ShowRule Int Selector (forall (m :: Type -> Type). Monad m => Content -> MP m (Seq Content)) |

#### Instances

Instances details

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

data Counter #

Constructors

CounterCustom !Text |
CounterLabel !Text |
CounterSelector !Selector |
CounterPage |

#### Instances

Instances details

Show Counter # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Counter -> ShowS # show :: Counter -> String # showList :: [Counter] -> ShowS #
Eq Counter # |
Instance details Defined in Typst.Types Methods (==) :: Counter -> Counter -> Bool # (/=) :: Counter -> Counter -> Bool #
Ord Counter # |
Instance details Defined in Typst.Types Methods compare :: Counter -> Counter -> Ordering # (<) :: Counter -> Counter -> Bool # (<=) :: Counter -> Counter -> Bool # (>) :: Counter -> Counter -> Bool # (>=) :: Counter -> Counter -> Bool # max :: Counter -> Counter -> Counter # min :: Counter -> Counter -> Counter #
FromVal Counter # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Counter #

data LUnit #

Constructors

LEm |
LPt |
LIn |
LCm |
LMm |

#### Instances

Instances details

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

data Length #

Constructors

LExact Double LUnit |
LRatio !Rational |
LSum Length Length |

#### Instances

Instances details

Monoid Length # |
Instance details Defined in Typst.Types Methods mempty :: Length # mappend :: Length -> Length -> Length # mconcat :: [Length] -> Length #
Semigroup Length # |
Instance details Defined in Typst.Types Methods (<>) :: Length -> Length -> Length # sconcat :: NonEmpty Length -> Length # stimes :: Integral b => b -> Length -> Length #
Show Length # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Length -> ShowS # show :: Length -> String # showList :: [Length] -> ShowS #
Eq Length # |
Instance details Defined in Typst.Types Methods (==) :: Length -> Length -> Bool # (/=) :: Length -> Length -> Bool #
FromVal Length # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Length #

renderLength :: Bool -> Length -> Text #

data Horiz #

Constructors

HorizStart |
HorizEnd |
HorizLeft |
HorizCenter |
HorizRight |

#### Instances

Instances details

Show Horiz # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Horiz -> ShowS # show :: Horiz -> String # showList :: [Horiz] -> ShowS #
Eq Horiz # |
Instance details Defined in Typst.Types Methods (==) :: Horiz -> Horiz -> Bool # (/=) :: Horiz -> Horiz -> Bool #
Ord Horiz # |
Instance details Defined in Typst.Types Methods compare :: Horiz -> Horiz -> Ordering # (<) :: Horiz -> Horiz -> Bool # (<=) :: Horiz -> Horiz -> Bool # (>) :: Horiz -> Horiz -> Bool # (>=) :: Horiz -> Horiz -> Bool # max :: Horiz -> Horiz -> Horiz # min :: Horiz -> Horiz -> Horiz #

data Vert #

Constructors

VertTop |
VertHorizon |
VertBottom |

#### Instances

Instances details

Show Vert # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Vert -> ShowS # show :: Vert -> String # showList :: [Vert] -> ShowS #
Eq Vert # |
Instance details Defined in Typst.Types Methods (==) :: Vert -> Vert -> Bool # (/=) :: Vert -> Vert -> Bool #
Ord Vert # |
Instance details Defined in Typst.Types Methods compare :: Vert -> Vert -> Ordering # (<) :: Vert -> Vert -> Bool # (<=) :: Vert -> Vert -> Bool # (>) :: Vert -> Vert -> Bool # (>=) :: Vert -> Vert -> Bool # max :: Vert -> Vert -> Vert # min :: Vert -> Vert -> Vert #

data Color #

Constructors

RGB Rational Rational Rational Rational |
CMYK Rational Rational Rational Rational |
Luma Rational |

#### Instances

Instances details

Show Color # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Color -> ShowS # show :: Color -> String # showList :: [Color] -> ShowS #
Eq Color # |
Instance details Defined in Typst.Types Methods (==) :: Color -> Color -> Bool # (/=) :: Color -> Color -> Bool #
Ord Color # |
Instance details Defined in Typst.Types Methods compare :: Color -> Color -> Ordering # (<) :: Color -> Color -> Bool # (<=) :: Color -> Color -> Bool # (>) :: Color -> Color -> Bool # (>=) :: Color -> Color -> Bool # max :: Color -> Color -> Color # min :: Color -> Color -> Color #

data Direction #

Constructors

Ltr | Left to right
Rtl | Right to left
Ttb | Top to bottom
Btt | Bottom to top

#### Instances

Instances details

Show Direction # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Direction -> ShowS # show :: Direction -> String # showList :: [Direction] -> ShowS #
Eq Direction # |
Instance details Defined in Typst.Types Methods (==) :: Direction -> Direction -> Bool # (/=) :: Direction -> Direction -> Bool #
Ord Direction # |
Instance details Defined in Typst.Types Methods compare :: Direction -> Direction -> Ordering # (<) :: Direction -> Direction -> Bool # (<=) :: Direction -> Direction -> Bool # (>) :: Direction -> Direction -> Bool # (>=) :: Direction -> Direction -> Bool # max :: Direction -> Direction -> Direction # min :: Direction -> Direction -> Direction #
FromVal Direction # |
Instance details Defined in Typst.Types Methods fromVal :: (MonadPlus m, MonadFail m) => Val -> m Direction #

newtype Identifier #

Constructors

Identifier Text |

#### Instances

Instances details

Monoid Identifier # |
Instance details Defined in Typst.Syntax Methods mempty :: Identifier # mappend :: Identifier -> Identifier -> Identifier # mconcat :: [Identifier] -> Identifier #
Semigroup Identifier # |
Instance details Defined in Typst.Syntax Methods (<>) :: Identifier -> Identifier -> Identifier # sconcat :: NonEmpty Identifier -> Identifier # stimes :: Integral b => b -> Identifier -> Identifier #
Data Identifier # |
Instance details Defined in Typst.Syntax Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identifier -> c Identifier # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Identifier # toConstr :: Identifier -> Constr # dataTypeOf :: Identifier -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Identifier) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Identifier) # gmapT :: (forall b. Data b => b -> b) -> Identifier -> Identifier # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identifier -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identifier -> r # gmapQ :: (forall d. Data d => d -> u) -> Identifier -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Identifier -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identifier -> m Identifier # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identifier -> m Identifier # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identifier -> m Identifier #
IsString Identifier # |
Instance details Defined in Typst.Syntax Methods fromString :: String -> Identifier #
Show Identifier # |
Instance details Defined in Typst.Syntax Methods showsPrec :: Int -> Identifier -> ShowS # show :: Identifier -> String # showList :: [Identifier] -> ShowS #
Eq Identifier # |
Instance details Defined in Typst.Syntax Methods (==) :: Identifier -> Identifier -> Bool # (/=) :: Identifier -> Identifier -> Bool #
Ord Identifier # |
Instance details Defined in Typst.Syntax Methods compare :: Identifier -> Identifier -> Ordering # (<) :: Identifier -> Identifier -> Bool # (<=) :: Identifier -> Identifier -> Bool # (>) :: Identifier -> Identifier -> Bool # (>=) :: Identifier -> Identifier -> Bool # max :: Identifier -> Identifier -> Identifier # min :: Identifier -> Identifier -> Identifier #

lookupIdentifier :: forall (m :: Type -> Type). Monad m => Identifier -> MP m Val #

joinVals :: MonadFail m => Val -> Val -> m Val #

prettyVal :: Val -> Doc #

valToContent :: Val -> Seq Content #

prettyType :: ValType -> Text #

repr :: Val -> Text #

data Attempt a #

Constructors

Success a |
Failure String |

#### Instances

Instances details

Applicative Attempt # |
Instance details Defined in Typst.Types Methods pure :: a -> Attempt a # (<*>) :: Attempt (a -> b) -> Attempt a -> Attempt b # liftA2 :: (a -> b -> c) -> Attempt a -> Attempt b -> Attempt c # (*>) :: Attempt a -> Attempt b -> Attempt b # (<*) :: Attempt a -> Attempt b -> Attempt a #
Functor Attempt # |
Instance details Defined in Typst.Types Methods fmap :: (a -> b) -> Attempt a -> Attempt b # (<$) :: a -> Attempt b -> Attempt a #
Monad Attempt # |
Instance details Defined in Typst.Types Methods (>>=) :: Attempt a -> (a -> Attempt b) -> Attempt b # (>>) :: Attempt a -> Attempt b -> Attempt b # return :: a -> Attempt a #
MonadFail Attempt # |
Instance details Defined in Typst.Types Methods fail :: String -> Attempt a #
Show a => Show (Attempt a) # |
Instance details Defined in Typst.Types Methods showsPrec :: Int -> Attempt a -> ShowS # show :: Attempt a -> String # showList :: [Attempt a] -> ShowS #
Eq a => Eq (Attempt a) # |
Instance details Defined in Typst.Types Methods (==) :: Attempt a -> Attempt a -> Bool # (/=) :: Attempt a -> Attempt a -> Bool #
Ord a => Ord (Attempt a) # |
Instance details Defined in Typst.Types Methods compare :: Attempt a -> Attempt a -> Ordering # (<) :: Attempt a -> Attempt a -> Bool # (<=) :: Attempt a -> Attempt a -> Bool # (>) :: Attempt a -> Attempt a -> Bool # (>=) :: Attempt a -> Attempt a -> Bool # max :: Attempt a -> Attempt a -> Attempt a # min :: Attempt a -> Attempt a -> Attempt a #