úÎ!L—EÕW      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVSafe@ACÍWXYZ[\]^Safe456Özinza/Some containers have location for each element.zinzaLocated element.zinzaLocation, line and column.zinzaUnknown location.zinzaPretty-print location.Safe _zinza A very simple haskell expressionzinzaHaskell selector. zinza2Variable name, possibly a fieldname in the record. _`ab cdefSafe zinza Zinza types.The selectorGs tell how the Haskell value can be converted to primitive value. E.g.toType (Proxy :: Proxy Char)TyString (Just "return")Here, g converts h to i. zinzaboolean zinzastring zinzalistszinzarecordszinza functionsjzinzaCA record without fields is a unit type. Think of zero-field tuple: ().zinza Pretty print  . jSafe456+zinzaLocated expression.zinzaExpressions in templates.KNote: there are only eliminators; we cannot construct "bigger" expressions.zinzavariablezinzafield accessorzinzafunction applicationkzinza Abstraction.lzinza Instantiate with a variable typemzinzan instance gives substitution.klSafe456² zinzaTemplate parts.FWe use polymorphic recursion for de Bruijn indices. See materials on bound library.zinzaraw text blockzinza expression  expr : Stringzinzaconditional block,  expr : Boolzinza for loop,  expr : List azinza define blockzinza use blockzinzacommentszinza A list of s.ozinza Substitution. oSafeÂ!zinza%Class representing errors containing #s.5Without bugs, compiled template should not throw any #?s, as they are prevented statically, i.e. reported already as /s. !"#+*)('&%$,.-/321045p Safe"6zinzaTemplate values.7zinzabooleans8zinzastrings9zinzalists:zinzarecords;zinzafunctionqzinza Calculate   of the 6d. This is only an approximation, for list we look at first element if it exists, otherwise we use unitTy.6;:987q Safe$ŽrzinzaHParse template into nodes. No other than syntactic checks are performed.rzinzaname of the templatezinzacontents of the templater SafeX.`<zinza<P class tells how to convert the type into template parameters, and their types.,Class can be auto-derived for product types.@data R = R { recFoo :: String, recBar :: Char } deriving Genericninstance Zinza R where toType = genericToTypeSFP; toValue = genericToValueSFP; fromValue = genericFromValueSFP%displayTy $ toType (Proxy :: Proxy R)"{bar: String, foo: String}"szinzaPairs are encoded as { key: k, val: v }tzinzaThe A9 for function produces partial functions. Use with care.sThis means that higher order functions in templates might throw pure exception. They wont, if they are well-typed.<=>?@AB SafeX01Czinza"Configuration for module renderingEzinza module headerFzinzaname of the functionCDEFu Safe>HUVX9˜KzinzaPField renamer which will automatically strip lowercase prefix from field names.=data R = R { recFoo :: Int, recBar :: Char } deriving Generic,stripFieldPrefix (Proxy :: Proxy R) "recFoo""foo".If whole field is lower case, it's left intact<newtype Wrapped = Wrap { unwrap :: String } deriving Generic2stripFieldPrefix (Proxy :: Proxy Wrapped) "unwrap""unwrap"LzinzaGenerically derive = function.MzinzaL with K.NzinzaGenerically derive ? function.OzinzaN with K.QzinzaP with K.Lzinza field renamerNzinza field renamerPzinza field renamer<=>?@ABGHIJKLMNOPQSafeX:®vzinzanodes with root objectw!GPL-2.0-or-later AND BSD-3-ClauseSafeXAÁRzinza5Parse and compile the template into Haskell function.SzinzaLike R' but reads file and (possibly) throws ,.Tzinza$Parse and compile the template into i representing a Haskell module.UzinzaLike T' but reads file and (possibly) throws ,.Vzinza!Simple configuration to use with T or U.Rzinzaname of the templatezinzacontents of the templateVzinza module namezinzaimportsW  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWRSTUCDEFV<=>?@ABLNPMOQKIHGJ 6789:;45/0123,-.#$%&'()*+!"  SafeEÄxzinzai writer monad.yzinzaGet the written string.zzinzaTell i.xyz{ !"#$%&'()*+,-./0123456789:;<=>?@ABCC D E F G H I  J K L M N O P P Q R S T U V W X Y Z [ \ ]^_`abcdefghijklmnopqrstuvwxstyz{|}st~€ ‚ ƒ „ …†‡ˆ‰Š‹ zinza-0.2-9cahRZyd2i5GsVPYsRBW4MZinzaZinza.Indexing Zinza.Pos Zinza.Var Zinza.Type Zinza.Expr Zinza.Node Zinza.Errors Zinza.Value Zinza.Parser Zinza.Class Zinza.Module Zinza.Generic Zinza.Check Zinza.WriterTraversableWithLoctraverseWithLocLocatedLLoczeroLoc displayLocSelectorVarTyTyBoolTyStringTyListTyRecordTyFun displayTyLExprExprEVarEFieldEAppNodeNRawNExprNIfNFor NDefBlock NUseBlockNCommentNodes ThrowRuntime throwRuntimeAsRuntimeErrorasRuntimeError RuntimeErrorNotBool NotString NotRecordNotListFieldNotInRecord NotFunctionFunArgDontMatch CustomErrorCompileOrParseError ACompileError AParseError CompileErrorUnboundTopLevelVarShadowingBlockUnboundUseBlock ARuntimeError ParseErrorValueVBoolVStringVListVRecordVFuntoType toTypeListtoValue toValueList fromValue fromValueList ModuleConfigmcHeadermcRender GZinzaFrom GZinzaValue GZinzaType GFieldNamesstripFieldPrefix genericToTypegenericToTypeSFPgenericToValuegenericToValueSFPgenericFromValuegenericFromValueSFPparseAndCompileTemplateparseAndCompileTemplateIOparseAndCompileModuleparseAndCompileModuleIO simpleConfigCons:::IdxThereHereIndexingextractindexHsExprHsAppHsSelHsVarhsVaraccess accessMaybe displayHsExprbaseGHC.Basereturnghc-prim GHC.TypesCharStringtyUnit abstract1instantiate1ret $fMonadExprMonad>>==errorLoc valueType parseTemplate $fZinzaMap $fZinza-> checkModule checkNodescheckWriter execWritertell