Module
Yoga.Format.Render
- Package
- purescript-yoga-format
- Repository
- rowtype-yoga/purescript-yoga-format
#RenderInput Source
class RenderInput :: SList -> Type -> Constraintclass RenderInput segments input where
Typeclass dispatching between record and bare value input
Members
renderInput :: Proxy segments -> input -> Array String
Instances
(RenderSegments segments row) => RenderInput segments (Record row)(Interpolate a, RenderSingle segments) => RenderInput segments a
#RenderSingle Source
class RenderSingle :: SList -> Constraintclass RenderSingle segments where
Render a single-var template with a bare value
Members
renderSingle :: forall a. Interpolate a => Proxy segments -> a -> Array String
Instances
RenderSingle SNil(IsSymbol s, RenderSingle rest) => RenderSingle (SCons (Lit s) rest)(RenderLitOnly rest) => RenderSingle (SCons (Var v) rest)
#RenderLitOnly Source
class RenderLitOnly :: SList -> Constraintclass RenderLitOnly segments where
Render remaining segments that must all be literals
Members
renderLitOnly :: Proxy segments -> Array String
Instances
RenderLitOnly SNil(IsSymbol s, RenderLitOnly rest) => RenderLitOnly (SCons (Lit s) rest)
#RenderSegments Source
class RenderSegments :: SList -> Row Type -> Constraintclass RenderSegments segments row where
Render a parsed template's segments against a record
Members
renderSegments :: Proxy segments -> Record row -> Array String
Instances
RenderSegments SNil row(IsSymbol s, RenderSegments rest row) => RenderSegments (SCons (Lit s) rest) row(IsSymbol path, ResolveAndInterpolate path row, RenderSegments rest row) => RenderSegments (SCons (Var path) rest) row
#ResolveAndInterpolate Source
class ResolveAndInterpolate :: Symbol -> Row Type -> Constraintclass ResolveAndInterpolate path row where
Resolve a possibly-dotted path against a record and interpolate
Members
resolveAndInterpolate :: Proxy path -> Record row -> String
Instances
(Cons h t path, SplitOnFirstDot h t "" hasDot field rest, ResolveAndInterpolateSplit hasDot field rest row) => ResolveAndInterpolate path row
#SplitOnFirstDot Source
class SplitOnFirstDot :: Symbol -> Symbol -> Symbol -> Boolean -> Symbol -> Symbol -> Constraintclass SplitOnFirstDot head tail acc hasDot field rest | head tail acc -> hasDot field rest
Split a symbol on the first dot
Instances
SplitOnFirstDot "." tail acc True acc tail(Append acc h field) => SplitOnFirstDot h "" acc False field ""(Append acc h acc', Cons nextH nextT tail, SplitOnFirstDot nextH nextT acc' hasDot field rest) => SplitOnFirstDot h tail acc hasDot field rest
#ResolveAndInterpolateSplit Source
class ResolveAndInterpolateSplit :: Boolean -> Symbol -> Symbol -> Row Type -> Constraintclass ResolveAndInterpolateSplit hasDot field rest row where
Dispatch based on whether there was a dot
Members
Instances
(IsSymbol field, Cons field a tail row, Interpolate a) => ResolveAndInterpolateSplit False field rest row(IsSymbol field, Cons field (Record innerRow) tail row, ResolveAndInterpolate rest innerRow) => ResolveAndInterpolateSplit True field rest row