"      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                    Safe-InferredJRead everything from a process, either failure or both stderr and stdout.   Safe-Inferred Safe-InferredNone .=Convert a Haskell value to a value representing a Fay value. /=Convert a value representing a Fay value to a Haskell value. Parse a data type or record. )Parse a data constructor from an object. 0Make a simple ADT constructor from an object: { slot1: 1, slot2: 2} -> Foo 1 2 "Make a record from a key-value: { x: 1 } -> Foo { x = 1 } Parse a double. Parse an int. Parse a number. Parse a bool. Parse a string. Parse a Text. Parse an array. ./././ ./None03Maps names bound in the module to their real names 2 The keys are unqualified for locals and imports, ' the values are always fully qualified  Example contents:  [ (UnQUal main , Qual Main main)  , (UnQual take , Qual Prelude take)  , ( Qual M  insertWith, Qual Data.Map  insertWith) ] 1&Find the path of a locally bound name  Returns special values in the Fay$ module for primOps 2*Bind a list of names into the local scope - Right now all bindings are made unqualified 3NFind all names that are bound locally in this module, which excludes imports. !The built-in operations that aren't actually compiled from & anywhere, they come from runtime.js. They'?re in the names list so that they can be overriden by the user % in e.g. let a * b = a - b in 1 * 2. ASo we resolve them to Fay$, i.e. the prefix used for the runtime E support. $ is not allowed in Haskell module names, so there will be < no conflicts if a user decicdes to use a module named Fay. ?So e.g. will compile to (*) Fay$$mult, which is in runtime.js. 42Get module level names from a haskell module AST. 012340123402413 01234 Safe-Inferred  None8BThese are the data types that are serializable directly to native E JS data types. Strings, floating points and arrays. The others are: 7 actions in the JS monad, which are thunks that shouldn' t be forced > when serialized but wrapped up as JS zero-arg functions, and  unknown types can'.t be converted but should at least be forced. HLiteral value type. NA name of some kind. YExpression type. rStatement type. ~&The JavaScript FFI interfacing monad.  Error type. Print some value. 2Just a convenience class to generalize the parsing/ printing of  various types of syntax. Compile monad. State of the compiler. Configuration of the compiler. #The default compiler reader value. The default compiler state. /Helpful for writing qualified symbols (Fay.*). Helpful for some things. Helpful for some things. Default configuration. 56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ݩr}|{zyxwvutsYqponmlkjihgfedcba`_^]\[ZHMLKJINXWVUTSRQPO~8GFEDCBA@?>=<;:9576 5768GFEDCBA@?>=<;:9HMLKJIN XWVUTSRQPOYqponmlkjihgfedcba`_^]\[Zr }|{zyxwvuts~ None Extra the string from an ident. 0Make an identifier from the built-in HJ module. Wrap an expression in a thunk. Wrap an expression in a thunk. Generate unique names. ?Resolve a given maybe-qualified name to a fully qualifed name. 'Qualify a name for the current module. Make a top-level binding. KCreate a temporary environment and discard it after the given computation. ECreate a temporary scope and discard it after the given computation. 3Run a compiler and just get the scope information. &Bind a variable in the current scope. Emit exported names.  Force an expression in a thunk. )Is a JS expression a literal (constant)? !Extract the string from a qname.  qname :: QName -> String " qname (UnQual (Ident str)) = str 0 qname (UnQual (Symbol sym)) = jsEncodeName sym  qname i = error $ *qname: Expected unqualified ident, found:  ++ show i -- FIXME: 8Deconstruct a parse result (a la maybe, foldr, either). Get a config option. FOptimize pattern matching conditions by merging conditions in common. Throw a JS exception. )Throw a JS exception (in an expression). Is an alt a wildcard? Is a pattern a wildcard? =Generate a temporary, SCOPED name for testing conditions and  such. =Generate a temporary, SCOPED name for testing conditions and  such. We don'2t have name tracking yet, so instead we use this. Print out a compiler warning.  Pretty print a source location. >Get the flag used for GHC, this differs between GHC-7.6.0 and > GHC-everything-else so we need to specially test for that. It's  lame, but that'$s random flag name changes for you. None?Given a configuration, resolve any packages specified to their 7 data file directories for importing the *.hs sources. Resolve package. Describe package with ghc-pkg. ;Weinsworth : Why are you not using the GHC API which would B provide you this information like in modules like 2 Packages which has functions like $collectIncludeDirs :: [PackageConfig] -> [FilePath] 3and awesome stuff like that. What are you, stupid? BBatemen : Pretty much. I think this might be a little faster than C initializing GHC, and using the GHC API adds a lot of ( link time when you use it. Weinsworth : Uh huh. -Batemen: Yeah. Stop looking at me like that. #Get the share dirs of the package.  Alright.  Stop.  Collaborate and listen. You'/re gonna have to stop scrolling and read this. I can'7t figure out how to get the data-dirs from the package  description.  It doesn't seem to be in the Cabal API's PackageDescription type.  * It doesn')t seem to be in the ghc-pkg description.  * I can'8t find out how to read the Cabal configuration. Yeah, I 1 could probably find it eventually. Shut up.  So what I'1m doing is parsing the import-dirs  flag, which  appears in ghc-pkg's output like this: homechrisProjectsme fay-jquery cabal-devlibfay-jquery-0.1.0.0 ghc-7.4.1 And I';m going to replace lib  with share  and drop the ghc-*  = and that, under a *normal* configuration, gives the share  directory. Under an atypical situation, we're going to throw an error and D you guys will just have to submit a pull request or some code to  do this better, because I''ve got better things to be doing, like C climbing trees, baking cookies and reading books about zombies. =Might as well check the dir that we munged to death actually  exists. -___ - NoneAThis is a hack for names generated in the Haskell AST. Should be  removed once it's no longer needed. %Encode a Haskell name to JavaScript. 4Normalize the given name to JavaScript-valid names. "Print the given printer indented. Output a newline. ?Write out a string, updating the current position information. Intercalate monadic action. Concatenate two printables. !Print one of the kinds of names. Print an expression. Print a single statement. Print a list of statements. $Print (and properly encode) a name. 0Print special constructors (tuples, list, etc.) Print module name. 4Print (and properly encode to JS) a qualified name. 5Print literals. These need some special encoding for 6 JS-format literals. Could use the Text.JSON library.         NoneThe opposite of Ptr,. Serialize the specified polymorphic type.  foo :: Automatic a -> String >Do not serialize the specified type. This is useful for, e.g.   foo :: String -> String  foo = ffi "%1" AThis would normally serialize and unserialize the string, for no  reason, in this case. Instead:  ! foo :: Ptr String -> Ptr String %Will just give an identity function. Values that may be undefined 9 Defined x encodes to x, Undefined decodes to undefined. B An undefined property in a record will be removed when encoding. Values that may be null 1 Nullable x decodes to x, Null decodes to null.  )Contains allowed foreign function types.  Declare a foreign action.  Maybes are pretty common.  Functions are foreignable. JS values are foreignable. Tuples ! arrays are OK. Lists ! arrays are OK. Bools are OK. Characters are OK. Some numbers in JS are int. All numbers in JS are double.  Unit is OK.   The foreign value. Bottom.    ~  ~      NoneAppend two lists. 9Evaluate each action in the sequence from left to right,  and collect the results.  sequence :: [Fay a] -> Fay [a]     !"#$%&'()*+,-./0123456789:;<=>?@AB CDEFGHIJKLM!N"OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx#y$z%{|}~    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~    !"#$%&'()*+,-./0123456789:;<=>?@AB CDEFGHIJKLM!N"OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx#y$z%{|}~None  !"#$%&'()*+,-~    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~~  $ '"! (&%-,)#+*^]\ !   (.heg&,'-2F_`w%+9|~CLNOM5>=Z3cdabu<7Htr8xV"qAvi[j}?DB@6fKsk/z{y1mnop#);EG4Jl$*0:WYTUIXRSPQNone Compile an FFI call. &MWarn about uses of naked x.y which will not play nicely with Google Closure. '"Get arg types of a function type. (:Convert a Haskell type to an internal FFI representation. )Extract the type. *Expand a type application. +Generate a user-defined type. ,Translate: JS ! Fay. -Translate: Fay ! JS. .:Get a JS-representation of a fundamental type for encoding/ decoding. /Get the arity of a type. 07Format the FFI format string with the given arguments. #Location of the original FFI decl. Name of the to-be binding. The format string. Type signature. &12'()*+,-./0The format string.  Arguments.  The JS code. 3&12'()*+,-./03 None State. Optimize monad. @The arity of a function. Arity here is defined to be the number C of arguments that can be directly uncurried from a curried lambda  abstraction. So x y z -> if x then (a -> a) else (a -> a) has an  arity of 3, not 4. :Run an optimizer, which may output additional statements. @Perform any top-level cross-module optimizations and GO DEEP to  optimize further.  Perform tail-call optimization. 7Strip redundant forcing from the whole generated code. 9Strip redundant forcing from an application if possible. =Apply the given function to the top-level expressions in the  given statements. =Apply the given function to the top-level expressions in the  given statement. :Collect functions and their arity from the whole codeset.  Get the arity of an expression. 0Rename an uncurried copy of a curried function.  None8Run the compiler. ?Compile a Haskell source string to a JavaScript source string. ?Compile a Haskell source string to a JavaScript source string. 4Parse some Fay code. 5LApply incredibly simplistic CPP handling. It only recognizes the following:   #if FAY  #ifdef FAY  #ifndef FAY  #else  #endif INote that this implementation replaces all removed lines with blanks, so $ that line numbers remain accurate. 6The parse mode for Fay. ;Compile the given input and print the output out prettily. ?Compile a String of Fay and print it as beautified JavaScript. :Compile the given Fay code for the documentation. This is * specialised because the documentation isn't really real   compilation. "Compile the top-level Fay module. 7Don't re-import the same modules. 8BCollect record definitions and store record name and field names. / A ConDecl will have fields named slot1..slotN Compile Haskell module. 9Compile the given import. :Compile Haskell declaration. Compile a declaration. ;"Compile a top-level pattern bind. <)Compile a normal simple pattern binding. =Compile a data declaration. >DCompile a function which pattern matches (causing a case analysis). ?&Compile a right-hand-side expression. @Compile guards Compile Haskell expression. ACompile simple application. BCompile a negate application C7Compile an infix application, optimizing the JS cases. DCompile a list expression. ECompile an if. FCompile a lambda. GDesugar list comprehensions. H"Desugar left sections to lambdas. I"Desugar left sections to lambdas. JCompile case expressions. KCompile a do block. L#Compile a statement of a do block. M8Compile the given pattern against the given expression. N8Compile the given pattern against the given expression. O#Compile a pattern variable e.g. x. P Compile a record field pattern. Q.Compile a literal value from a pattern match. R$Compile as binding in pattern match S0Compile a record construction with named fields H | GHC will warn on uninitialized fields, they will be undefined in JS. TCompile a pattern application. UCompile a pattern list. V1Compile an infix pattern (e.g. cons and tuples.) WCompile a guarded alt. XCompile a let expression. YCompile let declaration. ZCompile Haskell literal. [BMaximum number of elements to allow in strict list representation  of arithmetic sequences. \ Compile [e1..] arithmetic sequences. ]Compile [e1..e3] arithmetic sequences. ^Optimize short literal [e1..e3] arithmetic sequences. _Compile [e1,e2..] arithmetic sequences. `Compile [e1,e2..e3] arithmetic sequences. a!Optimize short literal [e1,e2..e3] arithmetic sequences. Lbcde456fg7hi8jk9lmn:;<o=>?@pABCDqEFGHIJKLMNOPQRSrTUVWXYZ[\]^_`astu  Ibedc456fg7hi8jk9lmn:;<o=>?@pABCDqEFGHIJKLMNOPQRSrTUVWXYZ[\]^_`astu NoneBCompile the given file and write the output to the given path, or  if nothing given, stdout. HCompile the given file and write to the output, also generate any HTML. Compile the given file. v/Compile the given module to a runnable module. w!Print an this.x = x; export out. -Convert a Haskell filename to a JS filename. -Print a compile error for human consumption. vw56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~vwx !"#$%&'&(&)&*+,-.&/&01213456789:;<=>?@ABCDE1FGH$IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~jpS     \ddcc !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                     R      !"#$%&'()*+,-./0123456789:;<=>?@AB C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~         fay-0.12.0.0Language.Fay.PreludeLanguage.Fay.ConvertLanguage.Fay.ModuleScopeLanguage.Fay.TypesLanguage.Fay.Compiler.MiscLanguage.Fay.Compiler.PackagesLanguage.Fay.FFILanguage.Fay.Compiler.FFILanguage.Fay.Compiler.OptimizerLanguage.Fay.Compiler Language.FaySystem.Process.ExtraData.List.ExtraControl.Monad.IO Paths_fayLanguage.Fay.PrintLanguage.Fay.Stdlibghc-primGHC.PrimseqbaseGHC.Num- GHC.Classes==>=EqGHC.BaseMonad Data.DataDataGHC.ReadReadGHC.ShowShowData.Typeable.InternalTypeable GHC.TypesBoolCharDoubleInt integer-gmpGHC.Integer.TypeIntegerStringFalseTrue Data.MaybeNothingMaybe Text.ReadreadgmapMogmapMpgmapMgmapQigmapQgmapQrgmapQlgmapT dataCast2 dataCast1 dataTypeOftoConstrgunfoldgfoldlGHC.Real/Just*+typeOf/=<=&&||<> showToFay readFromFay ModuleScope resolveName bindAsLocals moduleLocalsfindTopLevelNamesSerializeContextSerializeUserArgSerializeAnywhereFundamentalType UnknownType AutomaticPtrTypeBoolTypeIntType DoubleType StringTypeDateTypeNullableDefined UserDefined TupleTypeListTypeJsType FunctionTypeJsLitJsBool JsFloatingJsIntJsStrJsCharJsName JsBuiltIn JsConstructorJsTmpJsParamJsApplyJsForceJsThunkJsParametrizedTypeJsThis JsNameVarJsExp JsUndefinedJsObjJsInfixJsNeqJsEqJsIndex JsInstanceOf JsThrowExpJsNewJsListJsUpdatePropExternJsGetPropExtern JsUpdatePropJsLookup JsGetPropJsParenJsNull JsTernaryIfJsNegAppJsAppJsFunJsRawExpJsStmtJsBlock JsContinueJsSetPropExtern JsSetPropJsUpdateJsWhileJsThrow JsEarlyReturnJsIf JsMappedVarJsVarFay CompileErrorUnableResolveCachedImportUnableResolveQualifiedUnableResolveUnqualifiedFfiFormatInvalidJavaScriptFfiFormatIncompleteArgFfiFormatNoSuchArgFfiFormatBadCharsFfiNeedsTypeSigCouldn'tFindImportRecursiveDoUnsupportedInvalidDoBlockLetUnsupportedUnsupportedModuleSyntax EmptyDoBlockUnsupportedQualStmtUnsupportedImportUnsupportedWhereInAltUnsupportedGuardedAltsUnsupportedRhsUnsupportedFieldPatternUnsupportedPatternUnsupportedOperatorUnsupportedLetBindingUnsupportedLiteralUnsupportedExpressionUnsupportedWhereInMatchUnsupportedMatchSyntaxUnsupportedExportSpecUnsupportedDeclaration ParseError PrintableprintJSPrinter runPrinter PrintStatepsPrettypsLinepsColumn psMapping psIndentLevelpsOutput psNewlineMapping mappingName mappingFrom mappingTo CompilesTo compileToCompile unCompile CompileReader readerConfig CompileState stateExportsstateExportsCachestateModuleName stateFilePathstateRecordTypes stateRecords stateFayToJs stateJsToFay stateImportedstateNameDepthstateLocalScopestateModuleScope CompileConfigconfigOptimizeconfigFlattenAppsconfigExportBuiltinsconfigPrettyPrintconfigHtmlWrapperconfigHtmlJSLibs configLibrary configWarnconfigFilePathconfigTypecheck configWallconfigGClosureconfigPackageConfconfigDirectoryIncludesaddConfigDirectoryIncludeaddConfigDirectoryIncludesconfigPackagesaddConfigPackageaddConfigPackages faySourceDirdefaultCompileReaderdefaultCompileStateunname fayBuiltinthunk stmtsThunk uniqueNamesqualify bindToplevelwithModuleScope withScope generateScopebindVar emitExportforce isConstant parseResultconfigoptimizePatConditionsthrowthrowExp isWildCardAlt isWildCardPatwithScopedTmpJsNamewithScopedTmpNamewarn printSrcLocanyM typeToRecs typeToFieldsgetGhcPackageDbFlagresolvePackagesresolvePackagedescribePackage shareDirscheckDirExistsPtr UndefinedNullForeignffiOrderingEQLTGTEitherRightLefterror undefinedshoweither fromInteger fromRationalnegateabssignumpiexpsqrtlog**^^^logBasesintancosasinatanacossinhtanhcoshasinhatanhacoshproperFractiontruncateroundceilingfloorsubtractevenoddgcdlcmcurryuncurrysndfstfindfilternotnullmapnubelemnotElemsortcomparesortByinsertBywhensuccpredenumFrom enumFromTo enumFromThenenumFromThenTozipWithzipWith3zipzip3unzipunzip3linesunlineswordsunwordsflipmaybe.++$concat concatMapfoldrfoldr1foldlfoldl1andoranyallmaximumminimumproductsumscanlscanl1scanrscanr1lookup intersperse prependToAll intercalateforM_mapM_constlengthremquotquotRemdivmoddivModminmaxrecip fromIntegral otherwisereverse=<<sequence sequence_idasTypeOfuntil$!!!headtailinitlastiteraterepeat replicatecycletakedropsplitAt takeWhile dropWhilespanbreakprintputStrLn>>>>=failreturn compileFFI emitFayToJsfayToJsDispatcherjsToFayDispatcher emitJsToFayOptStateoptStmts optUncurryOptimize FuncArity runOptimizeroptimizeTopleveltcostripAndUncurrywalkAndStripForcesapplyToExpsInStmtsapplyToExpsInStmt collectFuncsexpAritytestuncurryBindingrenameUncurried runCompile compileViaStr compileToAst printCompileprintTestCompilecompileForDocscompileToplevelModule compileModule compileDecl compileExp compileFromTocompileFromToAndGenerateHtml compileFilecompileFileWithStatetoJsNameshowCompileErrorreadAllFromProcessunionOfforio parseData parseObject makeSimple makeRecord parseDoubleparseInt parseNumber parseBool parseString parseText parseArray envPrimOpsMap ModuleScopeStbindNamed_decl d_classDecl d_qualCon$fDefaultModuleScope$fMonoidModuleScopecatchIOversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileName$fIsStringModuleName$fIsStringQName$fIsStringName$fDefaultCompileConfig_configDirectoryIncludes_configPackages$fErrorCompileError$fDefaultPrintState encodeName normalizeNameindentednewlinewrite intercalateM+>$fPrintableJsName$fPrintableJsExp$fPrintableJsStmt$fPrintable[]0$fPrintableName$fPrintableSpecialCon$fPrintableModuleName$fPrintableQName$fPrintableJsLit printJSString printJSPretty reservedWords$fPrintablePrinter $fPrintable[]$fForeignMaybe $fForeign(->) $fForeignFay $fForeign(,) $fForeign[] $fForeignBool $fForeignChar $fForeignInt$fForeignDouble $fForeign()$fForeignDefined$fForeignNullable$fForeign(,,,,,,)$fForeign(,,,,,)$fForeign(,,,,)$fForeign(,,,) $fForeign(,,)concerror' unsafePownub' enumFromBy enumFromByTolength'rem'quot' warnDotUsesfunctionTypeArgsargTypebangType expandApp userDefinedjsToFayfayToJstypeRep typeArity formatFFItranscodingObjtranscodingObjForced explodeFieldsparseFayapplyCPP parseModeinitialPass_unlessImportedinitialPass_dataDecl compileImport compileDeclscompilePatBindcompileUnguardedRhscompileDataDeclcompileFunCase compileRhs compileGuards compileApp compileNegAppcompileInfixApp compileList compileIf compileLambdadesugarListCompdesugarLeftSectiondesugarRightSection compileCasecompileDoBlock compileStmt compilePatAlt compilePat compilePVarcompilePatFields compilePLit compilePAsPatcompileRecConstr compilePApp compilePListcompileInfixPatcompileGuardedAlt compileLetcompileLetDecl compileLitmaxStrictASLencompileEnumFromcompileEnumFromTo optEnumFromTocompileEnumFromThencompileEnumFromThenTooptEnumFromThenToCPPStateCPPElseCPPIfNoCPP initialPassinitialPass_importinitialPass_recordsinitialPass_decl typecheck findImportimportedcompileImportWithFilterunlessImported convertGADT compileVarmakeList updateRec$fCompilesToExpJsExp$fCompilesToDecl[]$fCompilesToModule[]compileToModule printExport