Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type family Format (str :: Symbol) where ...
- newtype Arg (n :: Nat) (s :: Symbol) = Arg Builder
- data Rec as where
- type family ContFormat (n :: Nat) (a :: Maybe (Char, Symbol)) where ...
- type family SkipOne (n :: Nat) (s :: Maybe (Char, Symbol)) where ...
- type family TryGetArg n rest where ...
- type family TakeName (a :: Maybe (Char, Symbol)) :: Symbol where ...
- type family SkipName (a :: Maybe (Char, Symbol)) :: Symbol where ...
- class Interpolate args where
- fmt :: forall str. (KnownSymbol str, Interpolate (Format str)) => (Rec '[] -> Rec (Format str)) -> Builder
Documentation
type family Format (str :: Symbol) where ... Source #
Format str = ContFormat 0 (UnconsSymbol str) |
newtype Arg (n :: Nat) (s :: Symbol) Source #
Instances
(Interpolate args, KnownNat i) => Interpolate (Arg i n ': args) Source # | |
Defined in Typist.Internal.Format |
type family ContFormat (n :: Nat) (a :: Maybe (Char, Symbol)) where ... Source #
ContFormat n ('Just '('\\', rest)) = SkipOne (n + 1) (UnconsSymbol rest) | |
ContFormat n ('Just '('#', rest)) = TryGetArg n (UnconsSymbol rest) | |
ContFormat n ('Just '(a, rest)) = ContFormat (n + 1) (UnconsSymbol rest) | |
ContFormat n 'Nothing = '[] |
type family SkipOne (n :: Nat) (s :: Maybe (Char, Symbol)) where ... Source #
SkipOne n 'Nothing = ContFormat n 'Nothing | |
SkipOne n ('Just '(a, rest)) = ContFormat (n + 1) (UnconsSymbol rest) |
type family TryGetArg n rest where ... Source #
TryGetArg n ('Just '('{', rest)) = Arg n (TakeName (UnconsSymbol rest)) ': ContFormat (n + 2) (UnconsSymbol (SkipName (UnconsSymbol rest))) | |
TryGetArg n 'Nothing = ContFormat n 'Nothing | |
TryGetArg n ('Just '(a, rest)) = ContFormat (n + 2) (UnconsSymbol rest) |
class Interpolate args where Source #
Instances
Interpolate ('[] :: [Type]) Source # | |
Defined in Typist.Internal.Format | |
(Interpolate args, KnownNat i) => Interpolate (Arg i n ': args) Source # | |
Defined in Typist.Internal.Format |
fmt :: forall str. (KnownSymbol str, Interpolate (Format str)) => (Rec '[] -> Rec (Format str)) -> Builder Source #
See usage example next to
at Typist.TextShow#=