Module "FlatCurry" Nothing [(ImportDecl (1,1) "Prelude" False Nothing Nothing) ,(ImportDecl (14,1) "Directory" False Nothing (Just (Importing (14,17) [(Import (Ident "doesFileExist" 0))]))) ,(ImportDecl (15,1) "ReadShowTerm" False Nothing Nothing) ,(ImportDecl (16,1) "Distribution" False Nothing Nothing) ,(ImportDecl (17,1) "FileGoodies" False Nothing (Just (Importing (17,19) [(Import (Ident "stripSuffix" 0))]))) ,(DataDecl (33,1) (Ident "Prog" 0) [] [(ConstrDecl (33,13) [] (Ident "Prog" 0) [(ConstructorType (QualIdent Nothing (Ident "String" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "String" 0)) [])),(ListType (ConstructorType (QualIdent Nothing (Ident "TypeDecl" 0)) [])),(ListType (ConstructorType (QualIdent Nothing (Ident "FuncDecl" 0)) [])),(ListType (ConstructorType (QualIdent Nothing (Ident "OpDecl" 0)) []))])]) ,(TypeDecl (40,1) (Ident "QName" 0) [] (TupleType [(ConstructorType (QualIdent Nothing (Ident "String" 0)) []),(ConstructorType (QualIdent Nothing (Ident "String" 0)) [])])) ,(DataDecl (44,1) (Ident "Visibility" 0) [] [(ConstrDecl (44,19) [] (Ident "Public" 0) []),(ConstrDecl (45,19) [] (Ident "Private" 0) [])]) ,(TypeDecl (49,1) (Ident "TVarIndex" 0) [] (ConstructorType (QualIdent Nothing (Ident "Int" 0)) [])) ,(DataDecl (70,1) (Ident "TypeDecl" 0) [] [(ConstrDecl (70,17) [] (Ident "Type" 0) [(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Visibility" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "TVarIndex" 0)) [])),(ListType (ConstructorType (QualIdent Nothing (Ident "ConsDecl" 0)) []))]),(ConstrDecl (71,17) [] (Ident "TypeSyn" 0) [(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Visibility" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "TVarIndex" 0)) [])),(ConstructorType (QualIdent Nothing (Ident "TypeExpr" 0)) [])])]) ,(DataDecl (76,1) (Ident "ConsDecl" 0) [] [(ConstrDecl (76,17) [] (Ident "Cons" 0) [(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Int" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Visibility" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "TypeExpr" 0)) []))])]) ,(DataDecl (87,1) (Ident "TypeExpr" 0) [] [(ConstrDecl (88,6) [] (Ident "TVar" 0) [(ConstructorType (QualIdent Nothing (Ident "TVarIndex" 0)) [])]),(ConstrDecl (89,6) [] (Ident "FuncType" 0) [(ConstructorType (QualIdent Nothing (Ident "TypeExpr" 0)) []),(ConstructorType (QualIdent Nothing (Ident "TypeExpr" 0)) [])]),(ConstrDecl (90,6) [] (Ident "TCons" 0) [(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "TypeExpr" 0)) []))])]) ,(DataDecl (98,1) (Ident "OpDecl" 0) [] [(ConstrDecl (98,15) [] (Ident "Op" 0) [(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Fixity" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Int" 0)) [])])]) ,(DataDecl (101,1) (Ident "Fixity" 0) [] [(ConstrDecl (101,15) [] (Ident "InfixOp" 0) []),(ConstrDecl (101,25) [] (Ident "InfixlOp" 0) []),(ConstrDecl (101,36) [] (Ident "InfixrOp" 0) [])]) ,(TypeDecl (108,1) (Ident "VarIndex" 0) [] (ConstructorType (QualIdent Nothing (Ident "Int" 0)) [])) ,(DataDecl (133,1) (Ident "FuncDecl" 0) [] [(ConstrDecl (133,17) [] (Ident "Func" 0) [(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Int" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Visibility" 0)) []),(ConstructorType (QualIdent Nothing (Ident "TypeExpr" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Rule" 0)) [])])]) ,(DataDecl (139,1) (Ident "Rule" 0) [] [(ConstrDecl (139,13) [] (Ident "Rule" 0) [(ListType (ConstructorType (QualIdent Nothing (Ident "VarIndex" 0)) [])),(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) [])]),(ConstrDecl (140,13) [] (Ident "External" 0) [(ConstructorType (QualIdent Nothing (Ident "String" 0)) [])])]) ,(DataDecl (145,1) (Ident "CaseType" 0) [] [(ConstrDecl (145,17) [] (Ident "Rigid" 0) []),(ConstrDecl (145,25) [] (Ident "Flex" 0) [])]) ,(DataDecl (158,1) (Ident "CombType" 0) [] [(ConstrDecl (158,17) [] (Ident "FuncCall" 0) []),(ConstrDecl (158,28) [] (Ident "ConsCall" 0) []),(ConstrDecl (158,39) [] (Ident "FuncPartCall" 0) [(ConstructorType (QualIdent Nothing (Ident "Int" 0)) [])]),(ConstrDecl (158,58) [] (Ident "ConsPartCall" 0) [(ConstructorType (QualIdent Nothing (Ident "Int" 0)) [])])]) ,(DataDecl (208,1) (Ident "Expr" 0) [] [(ConstrDecl (208,13) [] (Ident "Var" 0) [(ConstructorType (QualIdent Nothing (Ident "VarIndex" 0)) [])]),(ConstrDecl (209,13) [] (Ident "Lit" 0) [(ConstructorType (QualIdent Nothing (Ident "Literal" 0)) [])]),(ConstrDecl (210,13) [] (Ident "Comb" 0) [(ConstructorType (QualIdent Nothing (Ident "CombType" 0)) []),(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "Expr" 0)) []))]),(ConstrDecl (211,13) [] (Ident "Let" 0) [(ListType (TupleType [(ConstructorType (QualIdent Nothing (Ident "VarIndex" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) [])])),(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) [])]),(ConstrDecl (212,13) [] (Ident "Free" 0) [(ListType (ConstructorType (QualIdent Nothing (Ident "VarIndex" 0)) [])),(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) [])]),(ConstrDecl (213,13) [] (Ident "Or" 0) [(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) [])]),(ConstrDecl (214,13) [] (Ident "Case" 0) [(ConstructorType (QualIdent Nothing (Ident "CaseType" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "BranchExpr" 0)) []))])]) ,(DataDecl (230,1) (Ident "BranchExpr" 0) [] [(ConstrDecl (230,19) [] (Ident "Branch" 0) [(ConstructorType (QualIdent Nothing (Ident "Pattern" 0)) []),(ConstructorType (QualIdent Nothing (Ident "Expr" 0)) [])])]) ,(DataDecl (234,1) (Ident "Pattern" 0) [] [(ConstrDecl (234,16) [] (Ident "Pattern" 0) [(ConstructorType (QualIdent Nothing (Ident "QName" 0)) []),(ListType (ConstructorType (QualIdent Nothing (Ident "VarIndex" 0)) []))]),(ConstrDecl (235,16) [] (Ident "LPattern" 0) [(ConstructorType (QualIdent Nothing (Ident "Literal" 0)) [])])]) ,(DataDecl (240,1) (Ident "Literal" 0) [] [(ConstrDecl (240,16) [] (Ident "Intc" 0) [(ConstructorType (QualIdent Nothing (Ident "Int" 0)) [])]),(ConstrDecl (241,16) [] (Ident "Floatc" 0) [(ConstructorType (QualIdent Nothing (Ident "Float" 0)) [])]),(ConstrDecl (242,16) [] (Ident "Charc" 0) [(ConstructorType (QualIdent Nothing (Ident "Char" 0)) [])])]) ,(TypeSig (252,1) [(Ident "readFlatCurry" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ConstructorType (QualIdent Nothing (Ident "IO" 0)) [(ConstructorType (QualIdent Nothing (Ident "Prog" 0)) [])]))) ,(FunctionDecl (253,1) (Ident "readFlatCurry" 0) [(Equation (253,1) (FunLhs (Ident "readFlatCurry" 0) [(VariablePattern (Ident "progfile" 2))]) (SimpleRhs (254,4) (Apply (Apply (Variable (QualIdent (Just "FlatCurry") (Ident "readFlatCurryWithParseOptions" 0))) (Variable (QualIdent Nothing (Ident "progfile" 2)))) (Paren (Apply (Apply (Variable (QualIdent (Just "Distribution") (Ident "setQuiet" 0))) (Constructor (QualIdent (Just "Prelude") (Ident "True" 0)))) (Variable (QualIdent (Just "Distribution") (Ident "defaultParams" 0)))))) []))]) ,(TypeSig (263,1) [(Ident "readFlatCurryWithParseOptions" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ArrowType (ConstructorType (QualIdent Nothing (Ident "FrontendParams" 0)) []) (ConstructorType (QualIdent Nothing (Ident "IO" 0)) [(ConstructorType (QualIdent Nothing (Ident "Prog" 0)) [])])))) ,(FunctionDecl (264,1) (Ident "readFlatCurryWithParseOptions" 0) [(Equation (264,1) (FunLhs (Ident "readFlatCurryWithParseOptions" 0) [(VariablePattern (Ident "progname" 4)),(VariablePattern (Ident "options" 4))]) (SimpleRhs (264,50) (Do [(StmtBind (VariablePattern (Ident "mbCurryFile" 6)) (Apply (Variable (QualIdent (Just "Distribution") (Ident "lookupFileInLoadPath" 0))) (Paren (InfixApply (Variable (QualIdent Nothing (Ident "progname" 4))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".curry")))))),(StmtBind (VariablePattern (Ident "mbLCurryFile" 7)) (Apply (Variable (QualIdent (Just "Distribution") (Ident "lookupFileInLoadPath" 0))) (Paren (InfixApply (Variable (QualIdent Nothing (Ident "progname" 4))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".lcurry")))))),(StmtExpr (IfThenElse (InfixApply (InfixApply (Variable (QualIdent Nothing (Ident "mbCurryFile" 6))) (InfixOp (QualIdent (Just "Prelude") (Ident "==" 0))) (Constructor (QualIdent (Just "Prelude") (Ident "Nothing" 0)))) (InfixOp (QualIdent (Just "Prelude") (Ident "&&" 0))) (InfixApply (Variable (QualIdent Nothing (Ident "mbLCurryFile" 7))) (InfixOp (QualIdent (Just "Prelude") (Ident "==" 0))) (Constructor (QualIdent (Just "Prelude") (Ident "Nothing" 0))))) (Variable (QualIdent (Just "Prelude") (Ident "done" 0))) (Apply (Apply (Apply (Variable (QualIdent (Just "Distribution") (Ident "callFrontendWithParams" 0))) (Constructor (QualIdent (Just "Distribution") (Ident "FCY" 0)))) (Variable (QualIdent Nothing (Ident "options" 4)))) (Variable (QualIdent Nothing (Ident "progname" 4)))))),(StmtBind (VariablePattern (Ident "filename" 8)) (Apply (Variable (QualIdent (Just "Distribution") (Ident "findFileInLoadPath" 0))) (Paren (InfixApply (Variable (QualIdent Nothing (Ident "progname" 4))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".fcy"))))))] (Apply (Variable (QualIdent (Just "FlatCurry") (Ident "readFlatCurryFile" 0))) (Variable (QualIdent Nothing (Ident "filename" 8))))) []))]) ,(TypeSig (277,1) [(Ident "flatCurryFileName" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ConstructorType (QualIdent Nothing (Ident "String" 0)) []))) ,(FunctionDecl (278,1) (Ident "flatCurryFileName" 0) [(Equation (278,1) (FunLhs (Ident "flatCurryFileName" 0) [(VariablePattern (Ident "prog" 9))]) (SimpleRhs (278,26) (Apply (Variable (QualIdent (Just "Distribution") (Ident "inCurrySubdir" 0))) (Paren (InfixApply (Apply (Variable (QualIdent (Just "FileGoodies") (Ident "stripSuffix" 0))) (Variable (QualIdent Nothing (Ident "prog" 9)))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".fcy"))))) []))]) ,(TypeSig (283,1) [(Ident "flatCurryIntName" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ConstructorType (QualIdent Nothing (Ident "String" 0)) []))) ,(FunctionDecl (284,1) (Ident "flatCurryIntName" 0) [(Equation (284,1) (FunLhs (Ident "flatCurryIntName" 0) [(VariablePattern (Ident "prog" 11))]) (SimpleRhs (284,25) (Apply (Variable (QualIdent (Just "Distribution") (Ident "inCurrySubdir" 0))) (Paren (InfixApply (Apply (Variable (QualIdent (Just "FileGoodies") (Ident "stripSuffix" 0))) (Variable (QualIdent Nothing (Ident "prog" 11)))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".fint"))))) []))]) ,(TypeSig (292,1) [(Ident "readFlatCurryFile" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ConstructorType (QualIdent Nothing (Ident "IO" 0)) [(ConstructorType (QualIdent Nothing (Ident "Prog" 0)) [])]))) ,(FunctionDecl (293,1) (Ident "readFlatCurryFile" 0) [(Equation (293,1) (FunLhs (Ident "readFlatCurryFile" 0) [(VariablePattern (Ident "filename" 13))]) (SimpleRhs (293,30) (Do [(StmtBind (VariablePattern (Ident "exfcy" 18)) (Apply (Variable (QualIdent (Just "Directory") (Ident "doesFileExist" 0))) (Variable (QualIdent Nothing (Ident "filename" 13)))))] (IfThenElse (Variable (QualIdent Nothing (Ident "exfcy" 18))) (Apply (Variable (QualIdent Nothing (Ident "readExistingFCY" 14))) (Variable (QualIdent Nothing (Ident "filename" 13)))) (Do [(StmtDecl [(PatternDecl (297,16) (VariablePattern (Ident "subdirfilename" 19)) (SimpleRhs (297,33) (Apply (Variable (QualIdent (Just "Distribution") (Ident "inCurrySubdir" 0))) (Variable (QualIdent Nothing (Ident "filename" 13)))) []))]),(StmtBind (VariablePattern (Ident "exdirfcy" 21)) (Apply (Variable (QualIdent (Just "Directory") (Ident "doesFileExist" 0))) (Variable (QualIdent Nothing (Ident "subdirfilename" 19)))))] (IfThenElse (Variable (QualIdent Nothing (Ident "exdirfcy" 21))) (Apply (Variable (QualIdent Nothing (Ident "readExistingFCY" 14))) (Variable (QualIdent Nothing (Ident "subdirfilename" 19)))) (Apply (Variable (QualIdent (Just "Prelude") (Ident "error" 0))) (Paren (InfixApply (Literal (String "EXISTENCE ERROR: FlatCurry file '")) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (InfixApply (Variable (QualIdent Nothing (Ident "filename" 13))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String "' does not exist")))))))))) [(FunctionDecl (304,4) (Ident "readExistingFCY" 14) [(Equation (304,4) (FunLhs (Ident "readExistingFCY" 14) [(VariablePattern (Ident "fname" 15))]) (SimpleRhs (304,28) (Do [(StmtBind (VariablePattern (Ident "filecontents" 17)) (Apply (Variable (QualIdent (Just "Prelude") (Ident "readFile" 0))) (Variable (QualIdent Nothing (Ident "fname" 15)))))] (Apply (Variable (QualIdent (Just "Prelude") (Ident "return" 0))) (Paren (Apply (Variable (QualIdent (Just "ReadShowTerm") (Ident "readTerm" 0))) (Variable (QualIdent Nothing (Ident "filecontents" 17))))))) []))])]))]) ,(TypeSig (315,1) [(Ident "readFlatCurryInt" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ConstructorType (QualIdent Nothing (Ident "IO" 0)) [(ConstructorType (QualIdent Nothing (Ident "Prog" 0)) [])]))) ,(FunctionDecl (316,1) (Ident "readFlatCurryInt" 0) [(Equation (316,1) (FunLhs (Ident "readFlatCurryInt" 0) [(VariablePattern (Ident "progname" 22))]) (SimpleRhs (316,29) (Do [(StmtBind (VariablePattern (Ident "existsCurry" 24)) (Apply (Variable (QualIdent (Just "Directory") (Ident "doesFileExist" 0))) (Paren (InfixApply (Variable (QualIdent Nothing (Ident "progname" 22))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".curry")))))),(StmtBind (VariablePattern (Ident "existsLCurry" 25)) (Apply (Variable (QualIdent (Just "Directory") (Ident "doesFileExist" 0))) (Paren (InfixApply (Variable (QualIdent Nothing (Ident "progname" 22))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".lcurry")))))),(StmtExpr (IfThenElse (InfixApply (Variable (QualIdent Nothing (Ident "existsCurry" 24))) (InfixOp (QualIdent (Just "Prelude") (Ident "||" 0))) (Variable (QualIdent Nothing (Ident "existsLCurry" 25)))) (Apply (Apply (Variable (QualIdent (Just "Distribution") (Ident "callFrontend" 0))) (Constructor (QualIdent (Just "Distribution") (Ident "FINT" 0)))) (Variable (QualIdent Nothing (Ident "progname" 22)))) (Variable (QualIdent (Just "Prelude") (Ident "done" 0))))),(StmtBind (VariablePattern (Ident "filename" 26)) (Apply (Variable (QualIdent (Just "Distribution") (Ident "findFileInLoadPath" 0))) (Paren (InfixApply (Variable (QualIdent Nothing (Ident "progname" 22))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Literal (String ".fint"))))))] (Apply (Variable (QualIdent (Just "FlatCurry") (Ident "readFlatCurryFile" 0))) (Variable (QualIdent Nothing (Ident "filename" 26))))) []))]) ,(TypeSig (329,1) [(Ident "writeFCY" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ArrowType (ConstructorType (QualIdent Nothing (Ident "Prog" 0)) []) (ConstructorType (QualIdent Nothing (Ident "IO" 0)) [(TupleType [])])))) ,(FunctionDecl (330,1) (Ident "writeFCY" 0) [(Equation (330,1) (FunLhs (Ident "writeFCY" 0) [(VariablePattern (Ident "file" 27)),(VariablePattern (Ident "prog" 27))]) (SimpleRhs (330,22) (Apply (Apply (Variable (QualIdent (Just "Prelude") (Ident "writeFile" 0))) (Variable (QualIdent Nothing (Ident "file" 27)))) (Paren (Apply (Variable (QualIdent (Just "ReadShowTerm") (Ident "showTerm" 0))) (Variable (QualIdent Nothing (Ident "prog" 27)))))) []))]) ,(TypeSig (337,1) [(Ident "showQNameInModule" 0)] (ArrowType (ConstructorType (QualIdent Nothing (Ident "String" 0)) []) (ArrowType (TupleType [(ConstructorType (QualIdent Nothing (Ident "String" 0)) []),(ConstructorType (QualIdent Nothing (Ident "String" 0)) [])]) (ConstructorType (QualIdent Nothing (Ident "String" 0)) [])))) ,(FunctionDecl (338,1) (Ident "showQNameInModule" 0) [(Equation (338,1) (FunLhs (Ident "showQNameInModule" 0) [(VariablePattern (Ident "mod" 29)),(TuplePattern [(VariablePattern (Ident "qmod" 29)),(VariablePattern (Ident "name" 29))])]) (SimpleRhs (339,3) (IfThenElse (InfixApply (InfixApply (Variable (QualIdent Nothing (Ident "qmod" 29))) (InfixOp (QualIdent (Just "Prelude") (Ident "==" 0))) (Variable (QualIdent Nothing (Ident "mod" 29)))) (InfixOp (QualIdent (Just "Prelude") (Ident "||" 0))) (InfixApply (Variable (QualIdent Nothing (Ident "qmod" 29))) (InfixOp (QualIdent (Just "Prelude") (Ident "==" 0))) (Literal (String "Prelude")))) (Variable (QualIdent Nothing (Ident "name" 29))) (InfixApply (Variable (QualIdent Nothing (Ident "qmod" 29))) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (InfixApply (Literal (String ".")) (InfixOp (QualIdent (Just "Prelude") (Ident "++" 0))) (Variable (QualIdent Nothing (Ident "name" 29)))))) []))]) ]