diff --git a/homework/81906/hs2html.v2/README b/homework/81906/hs2html.v2/README new file mode 100644 index 00000000..b2666f16 --- /dev/null +++ b/homework/81906/hs2html.v2/README @@ -0,0 +1,4 @@ +spaghetti.tree е синтактичното дърво на spaghetti.hs, генерирано от tree-sitter +([1]) и неговата граматика за haskell([2]). +[1]: https://github.com/tree-sitter/tree-sitter +[2]: https://github.com/tree-sitter/tree-sitter-haskell \ No newline at end of file diff --git a/homework/81906/hs2html.v2/hs2html.flex b/homework/81906/hs2html.v2/hs2html.flex new file mode 100644 index 00000000..66f16986 --- /dev/null +++ b/homework/81906/hs2html.v2/hs2html.flex @@ -0,0 +1,140 @@ +/* scanner for Haskell */ + +%{ +#define YY_NO_UNISTD_H +%} + +DIGIT [0-9] +ID [a-z_]+[A-Za-z0-9_$]* +CLASSNAME [A-Za-z0-9]* +COMMENT --[\(\)\[\]\{\} \w]*\n +STRQ '([^\']|(\\\'))*' +STRDQ \"([^\"]|(\\\"))*\" +SFOLD \/\*\{[0-9]+\}|\/\* +FFOLD \*\/ + +%% + +{DIGIT}+ { + printf("%s", yytext); + } + +{DIGIT}+"."{DIGIT}* { + printf("%s", yytext); + } + +as|case|of|class|data|family|instance|default|deriving|instance|do|forall|foreign|hiding|if|then|else|import|infix|infixl|infixr|instance|let|in|mdo|module|newtype|proc|qualified|rec|type|family|instance|where { + printf("%s", yytext); +} + + +{ID} printf("%s", yytext); +{CLASSNAME} printf("%s", yytext); +{STRQ}|{STRDQ} printf("%s", yytext); +{COMMENT} printf("%s", yytext); + +"=" printf("%s", yytext); +"!" printf("%s", yytext); +"-" printf("%s", yytext); +"+" printf("%s", yytext); +"/" printf("%s", yytext); +"?" printf("%s", yytext); +"." printf("%s", yytext); +">" printf("%s", yytext); +"#" printf("%s", yytext); +"*" printf("%s", yytext); +"@" printf("%s", yytext); +"\\" printf("%s", yytext); +"`" printf("%s", yytext); +"|" printf("%s", yytext); +"~" printf("%s", yytext); +"&" printf("%s", yytext); +"-<" printf("%s", yytext); +"->" printf("%s", yytext); +"::" printf("%s", yytext); +"<-" printf("%s", yytext); +"=>" printf("%s", yytext); +"/=" printf("%s", yytext); +"-<<" printf("%s", yytext); + +{SFOLD} { +printf(""); +} +{FFOLD} printf(""); + +[;():?,\[\] \t\n]+ printf("%s", yytext); /* echo the rest */ + +. printf( "Unrecognized character: %s\n", yytext ); + +%% + +int yywrap() +{ + return 1; +} + + +int main(int argc, const char* argv[]) +{ + ++argv, --argc; /* skip over program name */ + if ( argc > 0 ) + yyin = fopen( argv[0], "r" ); + else + yyin = stdin; + + puts( + "" + "" + "
" + ""
+ );
+ yylex();
+ puts("");
+ return 0;
+}
diff --git a/homework/81906/hs2html.v2/lib/libtree-sitter.a b/homework/81906/hs2html.v2/lib/libtree-sitter.a
new file mode 100644
index 00000000..806e7170
Binary files /dev/null and b/homework/81906/hs2html.v2/lib/libtree-sitter.a differ
diff --git a/homework/81906/hs2html.v2/lib/libtree-sitter.so b/homework/81906/hs2html.v2/lib/libtree-sitter.so
new file mode 100755
index 00000000..650e1df0
Binary files /dev/null and b/homework/81906/hs2html.v2/lib/libtree-sitter.so differ
diff --git a/homework/81906/hs2html.v2/lib/libtree-sitter.so.0 b/homework/81906/hs2html.v2/lib/libtree-sitter.so.0
new file mode 100755
index 00000000..650e1df0
Binary files /dev/null and b/homework/81906/hs2html.v2/lib/libtree-sitter.so.0 differ
diff --git a/homework/81906/hs2html.v2/lib/libtree-sitter.so.0.0 b/homework/81906/hs2html.v2/lib/libtree-sitter.so.0.0
new file mode 100755
index 00000000..650e1df0
Binary files /dev/null and b/homework/81906/hs2html.v2/lib/libtree-sitter.so.0.0 differ
diff --git a/homework/81906/hs2html.v2/magic.sh b/homework/81906/hs2html.v2/magic.sh
new file mode 100755
index 00000000..e9d5fa70
--- /dev/null
+++ b/homework/81906/hs2html.v2/magic.sh
@@ -0,0 +1,6 @@
+grep rhs spaghetti.tree | sed 's/^[ ]*//' | sed 's/rhs: (//' | tr -d [,]- | tr -s ' ' | awk -F' ' '{ if ( $1 == "exp_do" || $1 == "exp_cond" || $1 == "exp_let_in") print($2, $3, $4, $5) }' > coordinatesOfBlocks
+./markBlocks
+flex hs2html.flex
+gcc lex.yy.c
+./a.out spaghetti.hs-foldable > spaghetti.html
+rm lex.yy.c a.out coordinatesOfBlocks spaghetti.hs-foldable
diff --git a/homework/81906/hs2html.v2/markBlocks b/homework/81906/hs2html.v2/markBlocks
new file mode 100755
index 00000000..684df642
Binary files /dev/null and b/homework/81906/hs2html.v2/markBlocks differ
diff --git a/homework/81906/hs2html.v2/markBlocks.cpp b/homework/81906/hs2html.v2/markBlocks.cpp
new file mode 100644
index 00000000..f9dff93a
--- /dev/null
+++ b/homework/81906/hs2html.v2/markBlocks.cpp
@@ -0,0 +1,31 @@
+#include+import Prelude +import Control.Monad +import Data.List.Split + +data File = File Unrecognized character: { +fileName::String, content::StringUnrecognized character: } + deriving (Eq, Show) +data Directory = Directory Unrecognized character: { +dirName::String, subDirectories::[Directory], files::[File]Unrecognized character: } + deriving (Eq, Show) + +addDirectory :: Maybe Directory -> String -> Directory +addDirectory (Just (Directory dirName dirs files)) name = + if (getSubDirectory name (Directory dirName dirs files)) == Nothing then + Directory dirName (dirs ++ [(Directory name [] [])]) files + else + (Directory dirName dirs files) + +hasFileHelper (File fileName content) targetName = + fileName == targetName + +hasFile :: [File] -> String -> Maybe File +hasFile [] _ = Nothing +hasFile fileList fileName = + if hasFileHelper (head fileList) fileName then + (Just (head fileList)) + else + hasFile (tail fileList) fileName + + +addFile :: File -> Directory -> Directory +addFile file (Directory dirName dirs files) = + if (hasFile files name) == Nothing then + Directory dirName dirs (files ++ [file]) + else + Directory dirName dirs files + where name = (fileName file) + +splitPath :: String -> [String] +splitPath path + | path !! 0 == '/' = "/":(splitOn "/" (tail path)) + | path !! 0 == '.' && path !! 1 == '/' = (splitOn "/" (drop 2 path)) + | path !! 0 == '.' && path !! 1 == '.' && path !! 2 == '/' = "/":(take ((length (splitOn "/" (drop 3 path))) - 1) (splitOn "/" (drop 3 path))) + | otherwise = splitOn "/" path + + +splitInput :: String -> [String] +splitInput input = splitOn " " input + +getSubDirectoryHelper :: String -> Directory -> Bool +getSubDirectoryHelper name directory = name == directoryName + where directoryName = dirName directory + +getSubDirectory :: String -> Directory -> Maybe Directory +getSubDirectory name (Directory dirname dirs files) + | name == "" = Just (Directory dirname dirs files) + | null dirs = Nothing + | getSubDirectoryHelper name (head dirs) = Just (head dirs) + | otherwise = getSubDirectory name (Directory dirname (tail dirs) files) + + +getDirectory :: [String] -> Maybe Directory -> Maybe Directory +getDirectory _ Nothing = Nothing +getDirectory [] (Just mainDirectory) = Just mainDirectory +getDirectory pathInList (Just mainDirectory) = + getDirectory (tail pathInList) (getSubDirectory (head pathInList) mainDirectory) + +cd :: String -> Directory -> Directory -> Maybe Directory +cd path mainDirectory currDirectory = + let k = (splitPath path) in + if (head k) == "/" then + getDirectory (tail k) (Just mainDirectory) + else + getDirectory k (Just currDirectory) + + +findFileHelper :: Maybe Directory -> String -> Maybe File +findFileHelper (Just (Directory _ _ files)) fileName = (hasFile files fileName) + +findFile :: String -> Directory -> Directory -> Maybe File +findFile path mainDirectory currDirectory = + let k = (splitPath path) in + if (head k) == "/" then + (findFileHelper (getDirectory (take ((length k) - 2) (tail k)) (Just mainDirectory)) (head (reverse k))) + else + (findFileHelper (getDirectory (take ((length k) - 1) (tail k )) (Just currDirectory)) (head (reverse k))) + +concatContent :: String -> Maybe File -> String +concatContent result (Just file) = (result ++ (content file)) + +inputFileContent :: String -> IO String +inputFileContent result = do + input <- getLine + if input == "." then + return result + else + inputFileContent (result ++ input ++ "\n") + +catGenCurrDir :: String -> String -> Directory -> Directory +catGenCurrDir fileName fileContent currDirectory = if (hasFile (files currDirectory) fileName) /= Nothing then + (addFile (File fileName fileContent) (rm fileName currDirectory)) + else + (addFile (File fileName fileContent) currDirectory) + +catInputFileHelper :: [String] -> String -> Directory -> Directory -> String -> IO () +catInputFileHelper paths path mainDirectory currDirectory result = do + let fileName = (head paths)-- (head (reverse (splitPath (head (tail paths))))) + fileContent <- (inputFileContent "") + let currDir = catGenCurrDir fileName fileContent currDirectory + putStrLn (show currDir) + let (Just mainDir) = (changeDirectory (Just mainDirectory) (splitPath path) currDir) + directoryRecursion (Just mainDir) path (cd path mainDir mainDir) + +catFileAssignHelper :: [String] -> String -> Directory -> Directory -> String -> IO () +catFileAssignHelper paths path mainDirectory currDirectory result = do + let fileName = (head paths)-- (head (reverse (splitPath path))) + let currDir = catGenCurrDir fileName result currDirectory-- (addFile (File fileName result) (rm fileName currDirectory)) + let (Just mainDir) = (changeDirectory (Just mainDirectory) (splitPath path) currDir) + directoryRecursion (Just mainDir) path (cd path mainDir mainDir) + +cat :: [String] -> String -> Directory -> Directory -> String -> IO () +cat paths path mainDirectory currDirectory result + | ((length paths) == 1) && ((head paths) /= ">") && (result == "") = + let (Just file) = (findFile (head paths) mainDirectory currDirectory) in putStrLn (content file) + | (head paths) == ">" && result /= "" = + catFileAssignHelper (tail paths) path mainDirectory currDirectory result + | (head paths) == ">" && result == "" = + catInputFileHelper (tail paths) path mainDirectory currDirectory result + | otherwise = cat (tail paths) path mainDirectory currDirectory (concatContent result (findFile (head paths) mainDirectory currDirectory)) + +mkdir :: String -> Directory -> Directory +mkdir name currDirectory = addDirectory (Just currDirectory) name + +conCatDirs :: [Directory] -> String -> String +conCatDirs [] result = result +conCatDirs dirs result = conCatDirs (tail dirs) (result ++ (dirName (head dirs)) ++ " ") + +conCatFiles :: [File] -> String -> String +conCatFiles [] result = result +conCatFiles files result = conCatFiles (tail files) (result ++ (fileName (head files)) ++ " ") + +conCatStringListHelper :: [String] -> String -> String -> String +conCatStringListHelper [] _ result = result +conCatStringListHelper stringList separator result = conCatStringListHelper (tail stringList) separator (result ++ separator ++ (head stringList)) + +conCatStringList :: [String] -> String -> String +conCatStringList stringList separator = conCatStringListHelper stringList separator "" + + +ls :: Directory -> IO () +ls (Directory dirName dirs files) = + putStrLn ((conCatDirs dirs "") ++ (conCatFiles files "") ) + +contentString :: Directory -> String +contentString directory = "/" + +touch name currDirectory = addFile (File name "") currDirectory + +rmDirHelper :: String -> [Directory] -> [Directory] +rmDirHelper dirname dirs + |null dirs = [] + |dirname == (dirName (head dirs)) = (tail dirs) + |otherwise = rmDirHelper dirname (tail dirs) + +rmdir :: String -> Directory -> Directory +rmdir dirName (Directory name dirs files) = + Directory name (rmDirHelper dirName dirs) files + +rmFileHelper :: String -> [File] -> [File] +rmFileHelper filename files + |null files = [] + |filename == (fileName (head files)) = (tail files) + |otherwise = rmFileHelper filename (tail files) + +rm :: String -> Directory -> Directory +rm fileName (Directory name dirs files) = + Directory name dirs (rmFileHelper fileName files) + +addDir :: Directory -> Maybe Directory -> Maybe Directory +addDir _ Nothing = Nothing +addDir (Directory dirName dirs file) (Just newDirectory) = + Just (Directory dirName (dirs ++ [newDirectory]) file) + +changeDirectory :: Maybe Directory -> [String] -> Directory -> Maybe Directory +changeDirectory Nothing _ _ = Nothing +changeDirectory _ [] changedDirectory = (Just changedDirectory) +changeDirectory (Just mainDirectory) pathInList changedDirectory = + let k = changeDirectory (cd (head pathInList) mainDirectory mainDirectory) (tail pathInList) changedDirectory in + if (dirName changedDirectory) == "/" then + Just changedDirectory + else + addDir (rmdir (head pathInList) mainDirectory) k -- Just changedDirectory + +rmMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO () +rmMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do + let changedDirectory = (rm (head (tail inputs)) currDirectory) + let pathList = (tail (splitPath path)) + let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory + let newCurrDirectory = (cd path newMainDirectory mainDirectory) + directoryRecursion (Just newMainDirectory) path newCurrDirectory + +mkdirMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO () +mkdirMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do + let changedDirectory = (mkdir (head (tail inputs)) currDirectory) + let pathList = (tail (splitPath path)) + let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory + let newCurrDirectory = (cd path newMainDirectory mainDirectory) + directoryRecursion (Just newMainDirectory) path newCurrDirectory + +touchMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO () +touchMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do + let changedDirectory = (touch (head (tail inputs)) currDirectory) + let pathList = (tail (splitPath path)) + let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory + let newCurrDirectory = (cd path newMainDirectory mainDirectory) + directoryRecursion (Just mainDirectory) path newCurrDirectory + +buildPath :: String -> String -> String +buildPath path next = if path == "/" then + (path ++ next) + else + (path ++ "/" ++ next) + +directoryRecursion :: Maybe Directory -> String -> Maybe Directory -> IO () +directoryRecursion (Just mainDirectory) path (Just currDirectory) = do + input <- getLine + let inputs = splitInput input + case head inputs of + "cat" -> cat (tail inputs) path mainDirectory currDirectory "" + "pwd" -> putStrLn path + "rm" -> rmMainHelper inputs (Just mainDirectory) path (Just currDirectory) + "mkdir" -> mkdirMainHelper inputs (Just mainDirectory) path (Just currDirectory) + "touch" -> touchMainHelper inputs (Just mainDirectory) path (Just currDirectory) + "ls" -> ls currDirectory-- same + "cd" -> if (cd (head (tail inputs)) mainDirectory currDirectory) == Nothing then + (putStrLn "Couldn't find this directory") + else + let newPath = (buildPath path (head (tail inputs))) in + (directoryRecursion (Just mainDirectory) newPath (cd (head (tail inputs)) mainDirectory currDirectory)) + _ -> putStrLn "Invalid operation!" + directoryRecursion (Just mainDirectory) path (Just currDirectory) + +main :: IO () +main = do + let mainDirectory = Directory "/" [] [] + directoryRecursion (Just mainDirectory) "/" (Just mainDirectory) + putStrLn (show mainDirectory) + putStrLn "ended" + return () + +diff --git a/homework/81906/hs2html.v2/spaghetti.tree b/homework/81906/hs2html.v2/spaghetti.tree new file mode 100644 index 00000000..c7a511e1 --- /dev/null +++ b/homework/81906/hs2html.v2/spaghetti.tree @@ -0,0 +1,3076 @@ +(haskell [0, 0] - [246, 0] + (import [0, 0] - [0, 14] + (module [0, 7] - [0, 14])) + (import [1, 0] - [1, 20] + (qualified_module [1, 7] - [1, 20] + (module [1, 7] - [1, 14]) + (module [1, 15] - [1, 20]))) + (import [2, 0] - [2, 22] + (qualified_module [2, 7] - [2, 22] + (module [2, 7] - [2, 11]) + (module [2, 12] - [2, 16]) + (module [2, 17] - [2, 22]))) + (adt [4, 0] - [4, 72] + name: (type [4, 5] - [4, 9]) + (constructors [4, 12] - [4, 52] + (data_constructor_record [4, 12] - [4, 52] + (constructor [4, 12] - [4, 16]) + (record_fields [4, 17] - [4, 52] + (field [4, 18] - [4, 34] + (variable [4, 18] - [4, 26]) + (type_name [4, 28] - [4, 34] + (type [4, 28] - [4, 34]))) + (comma [4, 34] - [4, 35]) + (field [4, 36] - [4, 51] + (variable [4, 36] - [4, 43]) + (type_name [4, 45] - [4, 51] + (type [4, 45] - [4, 51])))))) + (deriving [4, 53] - [4, 72] + class: (constraint [4, 63] - [4, 65] + class: (class_name [4, 63] - [4, 65] + (type [4, 63] - [4, 65]))) + (comma [4, 65] - [4, 66]) + class: (constraint [4, 67] - [4, 71] + class: (class_name [4, 67] - [4, 71] + (type [4, 67] - [4, 71]))))) + (adt [5, 0] - [5, 109] + name: (type [5, 5] - [5, 14]) + (constructors [5, 17] - [5, 88] + (data_constructor_record [5, 17] - [5, 88] + (constructor [5, 17] - [5, 26]) + (record_fields [5, 27] - [5, 88] + (field [5, 28] - [5, 43] + (variable [5, 28] - [5, 35]) + (type_name [5, 37] - [5, 43] + (type [5, 37] - [5, 43]))) + (comma [5, 43] - [5, 44]) + (field [5, 45] - [5, 72] + (variable [5, 45] - [5, 59]) + (type_list [5, 61] - [5, 72] + (type_name [5, 62] - [5, 71] + (type [5, 62] - [5, 71])))) + (comma [5, 72] - [5, 73]) + (field [5, 74] - [5, 87] + (variable [5, 74] - [5, 79]) + (type_list [5, 81] - [5, 87] + (type_name [5, 82] - [5, 86] + (type [5, 82] - [5, 86]))))))) + (deriving [5, 90] - [5, 109] + class: (constraint [5, 100] - [5, 102] + class: (class_name [5, 100] - [5, 102] + (type [5, 100] - [5, 102]))) + (comma [5, 102] - [5, 103]) + class: (constraint [5, 104] - [5, 108] + class: (class_name [5, 104] - [5, 108] + (type [5, 104] - [5, 108]))))) + (signature [7, 0] - [7, 54] + name: (variable [7, 0] - [7, 12]) + type: (fun [7, 16] - [7, 54] + (type_apply [7, 16] - [7, 31] + (type_name [7, 16] - [7, 21] + (type [7, 16] - [7, 21])) + (type_name [7, 22] - [7, 31] + (type [7, 22] - [7, 31]))) + (fun [7, 35] - [7, 54] + (type_name [7, 35] - [7, 41] + (type [7, 35] - [7, 41])) + (type_name [7, 45] - [7, 54] + (type [7, 45] - [7, 54]))))) + (function [8, 0] - [12, 38] + name: (variable [8, 0] - [8, 12]) + patterns: (patterns [8, 13] - [8, 55] + (pat_parens [8, 13] - [8, 50] + (pat_apply [8, 14] - [8, 49] + (pat_name [8, 14] - [8, 18] + (constructor [8, 14] - [8, 18])) + (pat_parens [8, 19] - [8, 49] + (pat_apply [8, 20] - [8, 48] + (pat_name [8, 20] - [8, 29] + (constructor [8, 20] - [8, 29])) + (pat_name [8, 30] - [8, 37] + (variable [8, 30] - [8, 37])) + (pat_name [8, 38] - [8, 42] + (variable [8, 38] - [8, 42])) + (pat_name [8, 43] - [8, 48] + (variable [8, 43] - [8, 48])))))) + (pat_name [8, 51] - [8, 55] + (variable [8, 51] - [8, 55]))) + rhs: (exp_cond [9, 4] - [12, 38] + if: (exp_infix [9, 7] - [9, 71] + (exp_parens [9, 7] - [9, 60] + (exp_apply [9, 8] - [9, 59] + (exp_name [9, 8] - [9, 23] + (variable [9, 8] - [9, 23])) + (exp_name [9, 24] - [9, 28] + (variable [9, 24] - [9, 28])) + (exp_parens [9, 29] - [9, 59] + (exp_apply [9, 30] - [9, 58] + (exp_name [9, 30] - [9, 39] + (constructor [9, 30] - [9, 39])) + (exp_name [9, 40] - [9, 47] + (variable [9, 40] - [9, 47])) + (exp_name [9, 48] - [9, 52] + (variable [9, 48] - [9, 52])) + (exp_name [9, 53] - [9, 58] + (variable [9, 53] - [9, 58])))))) + (operator [9, 61] - [9, 63]) + (exp_name [9, 64] - [9, 71] + (constructor [9, 64] - [9, 71]))) + then: (exp_apply [10, 8] - [10, 66] + (exp_name [10, 8] - [10, 17] + (constructor [10, 8] - [10, 17])) + (exp_name [10, 18] - [10, 25] + (variable [10, 18] - [10, 25])) + (exp_parens [10, 26] - [10, 60] + (exp_infix [10, 27] - [10, 59] + (exp_name [10, 27] - [10, 31] + (variable [10, 27] - [10, 31])) + (operator [10, 32] - [10, 34]) + (exp_list [10, 35] - [10, 59] + (exp_parens [10, 36] - [10, 58] + (exp_apply [10, 37] - [10, 57] + (exp_name [10, 37] - [10, 46] + (constructor [10, 37] - [10, 46])) + (exp_name [10, 47] - [10, 51] + (variable [10, 47] - [10, 51])) + (exp_literal [10, 52] - [10, 54] + (con_list [10, 52] - [10, 54])) + (exp_literal [10, 55] - [10, 57] + (con_list [10, 55] - [10, 57]))))))) + (exp_name [10, 61] - [10, 66] + (variable [10, 61] - [10, 66]))) + else: (exp_parens [12, 8] - [12, 38] + (exp_apply [12, 9] - [12, 37] + (exp_name [12, 9] - [12, 18] + (constructor [12, 9] - [12, 18])) + (exp_name [12, 19] - [12, 26] + (variable [12, 19] - [12, 26])) + (exp_name [12, 27] - [12, 31] + (variable [12, 27] - [12, 31])) + (exp_name [12, 32] - [12, 37] + (variable [12, 32] - [12, 37])))))) + (function [14, 0] - [15, 26] + name: (variable [14, 0] - [14, 13]) + patterns: (patterns [14, 14] - [14, 48] + (pat_parens [14, 14] - [14, 37] + (pat_apply [14, 15] - [14, 36] + (pat_name [14, 15] - [14, 19] + (constructor [14, 15] - [14, 19])) + (pat_name [14, 20] - [14, 28] + (variable [14, 20] - [14, 28])) + (pat_name [14, 29] - [14, 36] + (variable [14, 29] - [14, 36])))) + (pat_name [14, 38] - [14, 48] + (variable [14, 38] - [14, 48]))) + rhs: (exp_infix [15, 4] - [15, 26] + (exp_name [15, 4] - [15, 12] + (variable [15, 4] - [15, 12])) + (operator [15, 13] - [15, 15]) + (exp_name [15, 16] - [15, 26] + (variable [15, 16] - [15, 26])))) + (signature [17, 0] - [17, 41] + name: (variable [17, 0] - [17, 7]) + type: (fun [17, 11] - [17, 41] + (type_list [17, 11] - [17, 17] + (type_name [17, 12] - [17, 16] + (type [17, 12] - [17, 16]))) + (fun [17, 21] - [17, 41] + (type_name [17, 21] - [17, 27] + (type [17, 21] - [17, 27])) + (type_apply [17, 31] - [17, 41] + (type_name [17, 31] - [17, 36] + (type [17, 31] - [17, 36])) + (type_name [17, 37] - [17, 41] + (type [17, 37] - [17, 41])))))) + (function [18, 0] - [18, 22] + name: (variable [18, 0] - [18, 7]) + patterns: (patterns [18, 8] - [18, 12] + (pat_literal [18, 8] - [18, 10] + (con_list [18, 8] - [18, 10])) + (pat_wildcard [18, 11] - [18, 12])) + rhs: (exp_name [18, 15] - [18, 22] + (constructor [18, 15] - [18, 22]))) + (function [19, 0] - [23, 40] + name: (variable [19, 0] - [19, 7]) + patterns: (patterns [19, 8] - [19, 25] + (pat_name [19, 8] - [19, 16] + (variable [19, 8] - [19, 16])) + (pat_name [19, 17] - [19, 25] + (variable [19, 17] - [19, 25]))) + rhs: (exp_cond [20, 4] - [23, 40] + if: (exp_apply [20, 7] - [20, 45] + (exp_name [20, 7] - [20, 20] + (variable [20, 7] - [20, 20])) + (exp_parens [20, 21] - [20, 36] + (exp_apply [20, 22] - [20, 35] + (exp_name [20, 22] - [20, 26] + (variable [20, 22] - [20, 26])) + (exp_name [20, 27] - [20, 35] + (variable [20, 27] - [20, 35])))) + (exp_name [20, 37] - [20, 45] + (variable [20, 37] - [20, 45]))) + then: (exp_parens [21, 8] - [21, 30] + (exp_apply [21, 9] - [21, 29] + (exp_name [21, 9] - [21, 13] + (constructor [21, 9] - [21, 13])) + (exp_parens [21, 14] - [21, 29] + (exp_apply [21, 15] - [21, 28] + (exp_name [21, 15] - [21, 19] + (variable [21, 15] - [21, 19])) + (exp_name [21, 20] - [21, 28] + (variable [21, 20] - [21, 28])))))) + else: (exp_apply [23, 8] - [23, 40] + (exp_name [23, 8] - [23, 15] + (variable [23, 8] - [23, 15])) + (exp_parens [23, 16] - [23, 31] + (exp_apply [23, 17] - [23, 30] + (exp_name [23, 17] - [23, 21] + (variable [23, 17] - [23, 21])) + (exp_name [23, 22] - [23, 30] + (variable [23, 22] - [23, 30])))) + (exp_name [23, 32] - [23, 40] + (variable [23, 32] - [23, 40]))))) + (signature [26, 0] - [26, 41] + name: (variable [26, 0] - [26, 7]) + type: (fun [26, 11] - [26, 41] + (type_name [26, 11] - [26, 15] + (type [26, 11] - [26, 15])) + (fun [26, 19] - [26, 41] + (type_name [26, 19] - [26, 28] + (type [26, 19] - [26, 28])) + (type_name [26, 32] - [26, 41] + (type [26, 32] - [26, 41]))))) + (function [27, 0] - [32, 32] + name: (variable [27, 0] - [27, 7]) + patterns: (patterns [27, 8] - [27, 43] + (pat_name [27, 8] - [27, 12] + (variable [27, 8] - [27, 12])) + (pat_parens [27, 13] - [27, 43] + (pat_apply [27, 14] - [27, 42] + (pat_name [27, 14] - [27, 23] + (constructor [27, 14] - [27, 23])) + (pat_name [27, 24] - [27, 31] + (variable [27, 24] - [27, 31])) + (pat_name [27, 32] - [27, 36] + (variable [27, 32] - [27, 36])) + (pat_name [27, 37] - [27, 42] + (variable [27, 37] - [27, 42]))))) + rhs: (exp_cond [28, 4] - [31, 36] + if: (exp_infix [28, 7] - [28, 38] + (exp_parens [28, 7] - [28, 27] + (exp_apply [28, 8] - [28, 26] + (exp_name [28, 8] - [28, 15] + (variable [28, 8] - [28, 15])) + (exp_name [28, 16] - [28, 21] + (variable [28, 16] - [28, 21])) + (exp_name [28, 22] - [28, 26] + (variable [28, 22] - [28, 26])))) + (operator [28, 28] - [28, 30]) + (exp_name [28, 31] - [28, 38] + (constructor [28, 31] - [28, 38]))) + then: (exp_apply [29, 8] - [29, 48] + (exp_name [29, 8] - [29, 17] + (constructor [29, 8] - [29, 17])) + (exp_name [29, 18] - [29, 25] + (variable [29, 18] - [29, 25])) + (exp_name [29, 26] - [29, 30] + (variable [29, 26] - [29, 30])) + (exp_parens [29, 31] - [29, 48] + (exp_infix [29, 32] - [29, 47] + (exp_name [29, 32] - [29, 37] + (variable [29, 32] - [29, 37])) + (operator [29, 38] - [29, 40]) + (exp_list [29, 41] - [29, 47] + (exp_name [29, 42] - [29, 46] + (variable [29, 42] - [29, 46])))))) + else: (exp_apply [31, 8] - [31, 36] + (exp_name [31, 8] - [31, 17] + (constructor [31, 8] - [31, 17])) + (exp_name [31, 18] - [31, 25] + (variable [31, 18] - [31, 25])) + (exp_name [31, 26] - [31, 30] + (variable [31, 26] - [31, 30])) + (exp_name [31, 31] - [31, 36] + (variable [31, 31] - [31, 36])))) + (where [32, 4] - [32, 9]) + (decls [32, 10] - [32, 32] + (function [32, 10] - [32, 32] + name: (variable [32, 10] - [32, 14]) + rhs: (exp_parens [32, 17] - [32, 32] + (exp_apply [32, 18] - [32, 31] + (exp_name [32, 18] - [32, 26] + (variable [32, 18] - [32, 26])) + (exp_name [32, 27] - [32, 31] + (variable [32, 27] - [32, 31]))))))) + (signature [34, 0] - [34, 31] + name: (variable [34, 0] - [34, 9]) + type: (fun [34, 13] - [34, 31] + (type_name [34, 13] - [34, 19] + (type [34, 13] - [34, 19])) + (type_list [34, 23] - [34, 31] + (type_name [34, 24] - [34, 30] + (type [34, 24] - [34, 30]))))) + (function [35, 0] - [39, 34] + name: (variable [35, 0] - [35, 9]) + patterns: (patterns [35, 10] - [35, 14] + (pat_name [35, 10] - [35, 14] + (variable [35, 10] - [35, 14]))) + (guard_equation [36, 4] - [36, 54] + (guards [36, 4] - [36, 22] + (guard [36, 6] - [36, 22] + (exp_infix [36, 6] - [36, 22] + (exp_infix [36, 6] - [36, 15] + (exp_name [36, 6] - [36, 10] + (variable [36, 6] - [36, 10])) + (operator [36, 11] - [36, 13]) + (exp_literal [36, 14] - [36, 15] + (integer [36, 14] - [36, 15]))) + (operator [36, 16] - [36, 18]) + (exp_literal [36, 19] - [36, 22] + (char [36, 19] - [36, 22]))))) + (exp_infix [36, 25] - [36, 54] + (exp_literal [36, 25] - [36, 28] + (string [36, 25] - [36, 28])) + (constructor_operator [36, 28] - [36, 29]) + (exp_parens [36, 29] - [36, 54] + (exp_apply [36, 30] - [36, 53] + (exp_name [36, 30] - [36, 37] + (variable [36, 30] - [36, 37])) + (exp_literal [36, 38] - [36, 41] + (string [36, 38] - [36, 41])) + (exp_parens [36, 42] - [36, 53] + (exp_apply [36, 43] - [36, 52] + (exp_name [36, 43] - [36, 47] + (variable [36, 43] - [36, 47])) + (exp_name [36, 48] - [36, 52] + (variable [36, 48] - [36, 52])))))))) + (guard_equation [37, 4] - [37, 72] + (guards [37, 4] - [37, 42] + (guard [37, 6] - [37, 42] + (exp_infix [37, 6] - [37, 42] + (exp_infix [37, 6] - [37, 35] + (exp_infix [37, 6] - [37, 30] + (exp_infix [37, 6] - [37, 22] + (exp_infix [37, 6] - [37, 15] + (exp_name [37, 6] - [37, 10] + (variable [37, 6] - [37, 10])) + (operator [37, 11] - [37, 13]) + (exp_literal [37, 14] - [37, 15] + (integer [37, 14] - [37, 15]))) + (operator [37, 16] - [37, 18]) + (exp_literal [37, 19] - [37, 22] + (char [37, 19] - [37, 22]))) + (operator [37, 23] - [37, 25]) + (exp_name [37, 26] - [37, 30] + (variable [37, 26] - [37, 30]))) + (operator [37, 31] - [37, 33]) + (exp_literal [37, 34] - [37, 35] + (integer [37, 34] - [37, 35]))) + (operator [37, 36] - [37, 38]) + (exp_literal [37, 39] - [37, 42] + (char [37, 39] - [37, 42]))))) + (exp_parens [37, 45] - [37, 72] + (exp_apply [37, 46] - [37, 71] + (exp_name [37, 46] - [37, 53] + (variable [37, 46] - [37, 53])) + (exp_literal [37, 54] - [37, 57] + (string [37, 54] - [37, 57])) + (exp_parens [37, 58] - [37, 71] + (exp_apply [37, 59] - [37, 70] + (exp_name [37, 59] - [37, 63] + (variable [37, 59] - [37, 63])) + (exp_literal [37, 64] - [37, 65] + (integer [37, 64] - [37, 65])) + (exp_name [37, 66] - [37, 70] + (variable [37, 66] - [37, 70]))))))) + (guard_equation [38, 4] - [38, 146] + (guards [38, 4] - [38, 62] + (guard [38, 6] - [38, 62] + (exp_infix [38, 6] - [38, 62] + (exp_infix [38, 6] - [38, 55] + (exp_infix [38, 6] - [38, 50] + (exp_infix [38, 6] - [38, 42] + (exp_infix [38, 6] - [38, 35] + (exp_infix [38, 6] - [38, 30] + (exp_infix [38, 6] - [38, 22] + (exp_infix [38, 6] - [38, 15] + (exp_name [38, 6] - [38, 10] + (variable [38, 6] - [38, 10])) + (operator [38, 11] - [38, 13]) + (exp_literal [38, 14] - [38, 15] + (integer [38, 14] - [38, 15]))) + (operator [38, 16] - [38, 18]) + (exp_literal [38, 19] - [38, 22] + (char [38, 19] - [38, 22]))) + (operator [38, 23] - [38, 25]) + (exp_name [38, 26] - [38, 30] + (variable [38, 26] - [38, 30]))) + (operator [38, 31] - [38, 33]) + (exp_literal [38, 34] - [38, 35] + (integer [38, 34] - [38, 35]))) + (operator [38, 36] - [38, 38]) + (exp_literal [38, 39] - [38, 42] + (char [38, 39] - [38, 42]))) + (operator [38, 43] - [38, 45]) + (exp_name [38, 46] - [38, 50] + (variable [38, 46] - [38, 50]))) + (operator [38, 51] - [38, 53]) + (exp_literal [38, 54] - [38, 55] + (integer [38, 54] - [38, 55]))) + (operator [38, 56] - [38, 58]) + (exp_literal [38, 59] - [38, 62] + (char [38, 59] - [38, 62]))))) + (exp_infix [38, 65] - [38, 146] + (exp_literal [38, 65] - [38, 68] + (string [38, 65] - [38, 68])) + (constructor_operator [38, 68] - [38, 69]) + (exp_parens [38, 69] - [38, 146] + (exp_apply [38, 70] - [38, 145] + (exp_name [38, 70] - [38, 74] + (variable [38, 70] - [38, 74])) + (exp_parens [38, 75] - [38, 117] + (exp_infix [38, 76] - [38, 116] + (exp_parens [38, 76] - [38, 112] + (exp_apply [38, 77] - [38, 111] + (exp_name [38, 77] - [38, 83] + (variable [38, 77] - [38, 83])) + (exp_parens [38, 84] - [38, 111] + (exp_apply [38, 85] - [38, 110] + (exp_name [38, 85] - [38, 92] + (variable [38, 85] - [38, 92])) + (exp_literal [38, 93] - [38, 96] + (string [38, 93] - [38, 96])) + (exp_parens [38, 97] - [38, 110] + (exp_apply [38, 98] - [38, 109] + (exp_name [38, 98] - [38, 102] + (variable [38, 98] - [38, 102])) + (exp_literal [38, 103] - [38, 104] + (integer [38, 103] - [38, 104])) + (exp_name [38, 105] - [38, 109] + (variable [38, 105] - [38, 109])))))))) + (operator [38, 113] - [38, 114]) + (exp_literal [38, 115] - [38, 116] + (integer [38, 115] - [38, 116])))) + (exp_parens [38, 118] - [38, 145] + (exp_apply [38, 119] - [38, 144] + (exp_name [38, 119] - [38, 126] + (variable [38, 119] - [38, 126])) + (exp_literal [38, 127] - [38, 130] + (string [38, 127] - [38, 130])) + (exp_parens [38, 131] - [38, 144] + (exp_apply [38, 132] - [38, 143] + (exp_name [38, 132] - [38, 136] + (variable [38, 132] - [38, 136])) + (exp_literal [38, 137] - [38, 138] + (integer [38, 137] - [38, 138])) + (exp_name [38, 139] - [38, 143] + (variable [38, 139] - [38, 143])))))))))) + (guard_equation [39, 4] - [39, 34] + (guards [39, 4] - [39, 15] + (guard [39, 6] - [39, 15] + (exp_name [39, 6] - [39, 15] + (variable [39, 6] - [39, 15])))) + (exp_apply [39, 18] - [39, 34] + (exp_name [39, 18] - [39, 25] + (variable [39, 18] - [39, 25])) + (exp_literal [39, 26] - [39, 29] + (string [39, 26] - [39, 29])) + (exp_name [39, 30] - [39, 34] + (variable [39, 30] - [39, 34]))))) + (signature [42, 0] - [42, 32] + name: (variable [42, 0] - [42, 10]) + type: (fun [42, 14] - [42, 32] + (type_name [42, 14] - [42, 20] + (type [42, 14] - [42, 20])) + (type_list [42, 24] - [42, 32] + (type_name [42, 25] - [42, 31] + (type [42, 25] - [42, 31]))))) + (function [43, 0] - [43, 36] + name: (variable [43, 0] - [43, 10]) + patterns: (patterns [43, 11] - [43, 16] + (pat_name [43, 11] - [43, 16] + (variable [43, 11] - [43, 16]))) + rhs: (exp_apply [43, 19] - [43, 36] + (exp_name [43, 19] - [43, 26] + (variable [43, 19] - [43, 26])) + (exp_literal [43, 27] - [43, 30] + (string [43, 27] - [43, 30])) + (exp_name [43, 31] - [43, 36] + (variable [43, 31] - [43, 36])))) + (signature [45, 0] - [45, 52] + name: (variable [45, 0] - [45, 21]) + type: (fun [45, 25] - [45, 52] + (type_name [45, 25] - [45, 31] + (type [45, 25] - [45, 31])) + (fun [45, 35] - [45, 52] + (type_name [45, 35] - [45, 44] + (type [45, 35] - [45, 44])) + (type_name [45, 48] - [45, 52] + (type [45, 48] - [45, 52]))))) + (function [46, 0] - [47, 42] + name: (variable [46, 0] - [46, 21]) + patterns: (patterns [46, 22] - [46, 36] + (pat_name [46, 22] - [46, 26] + (variable [46, 22] - [46, 26])) + (pat_name [46, 27] - [46, 36] + (variable [46, 27] - [46, 36]))) + rhs: (exp_infix [46, 39] - [46, 60] + (exp_name [46, 39] - [46, 43] + (variable [46, 39] - [46, 43])) + (operator [46, 44] - [46, 46]) + (exp_name [46, 47] - [46, 60] + (variable [46, 47] - [46, 60]))) + (where [47, 3] - [47, 8]) + (decls [47, 9] - [47, 42] + (function [47, 9] - [47, 42] + name: (variable [47, 9] - [47, 22]) + rhs: (exp_apply [47, 25] - [47, 42] + (exp_name [47, 25] - [47, 32] + (variable [47, 25] - [47, 32])) + (exp_name [47, 33] - [47, 42] + (variable [47, 33] - [47, 42])))))) + (signature [49, 0] - [49, 57] + name: (variable [49, 0] - [49, 15]) + type: (fun [49, 19] - [49, 57] + (type_name [49, 19] - [49, 25] + (type [49, 19] - [49, 25])) + (fun [49, 29] - [49, 57] + (type_name [49, 29] - [49, 38] + (type [49, 29] - [49, 38])) + (type_apply [49, 42] - [49, 57] + (type_name [49, 42] - [49, 47] + (type [49, 42] - [49, 47])) + (type_name [49, 48] - [49, 57] + (type [49, 48] - [49, 57])))))) + (function [50, 0] - [54, 76] + name: (variable [50, 0] - [50, 15]) + patterns: (patterns [50, 16] - [50, 51] + (pat_name [50, 16] - [50, 20] + (variable [50, 16] - [50, 20])) + (pat_parens [50, 21] - [50, 51] + (pat_apply [50, 22] - [50, 50] + (pat_name [50, 22] - [50, 31] + (constructor [50, 22] - [50, 31])) + (pat_name [50, 32] - [50, 39] + (variable [50, 32] - [50, 39])) + (pat_name [50, 40] - [50, 44] + (variable [50, 40] - [50, 44])) + (pat_name [50, 45] - [50, 50] + (variable [50, 45] - [50, 50]))))) + (guard_equation [51, 4] - [51, 54] + (guards [51, 4] - [51, 16] + (guard [51, 6] - [51, 16] + (exp_infix [51, 6] - [51, 16] + (exp_name [51, 6] - [51, 10] + (variable [51, 6] - [51, 10])) + (operator [51, 11] - [51, 13]) + (exp_literal [51, 14] - [51, 16] + (string [51, 14] - [51, 16]))))) + (exp_apply [51, 19] - [51, 54] + (exp_name [51, 19] - [51, 23] + (constructor [51, 19] - [51, 23])) + (exp_parens [51, 24] - [51, 54] + (exp_apply [51, 25] - [51, 53] + (exp_name [51, 25] - [51, 34] + (constructor [51, 25] - [51, 34])) + (exp_name [51, 35] - [51, 42] + (variable [51, 35] - [51, 42])) + (exp_name [51, 43] - [51, 47] + (variable [51, 43] - [51, 47])) + (exp_name [51, 48] - [51, 53] + (variable [51, 48] - [51, 53])))))) + (guard_equation [52, 4] - [52, 25] + (guards [52, 4] - [52, 15] + (guard [52, 6] - [52, 15] + (exp_apply [52, 6] - [52, 15] + (exp_name [52, 6] - [52, 10] + (variable [52, 6] - [52, 10])) + (exp_name [52, 11] - [52, 15] + (variable [52, 11] - [52, 15]))))) + (exp_name [52, 18] - [52, 25] + (constructor [52, 18] - [52, 25]))) + (guard_equation [53, 4] - [53, 63] + (guards [53, 4] - [53, 44] + (guard [53, 6] - [53, 44] + (exp_apply [53, 6] - [53, 44] + (exp_name [53, 6] - [53, 27] + (variable [53, 6] - [53, 27])) + (exp_name [53, 28] - [53, 32] + (variable [53, 28] - [53, 32])) + (exp_parens [53, 33] - [53, 44] + (exp_apply [53, 34] - [53, 43] + (exp_name [53, 34] - [53, 38] + (variable [53, 34] - [53, 38])) + (exp_name [53, 39] - [53, 43] + (variable [53, 39] - [53, 43]))))))) + (exp_apply [53, 47] - [53, 63] + (exp_name [53, 47] - [53, 51] + (constructor [53, 47] - [53, 51])) + (exp_parens [53, 52] - [53, 63] + (exp_apply [53, 53] - [53, 62] + (exp_name [53, 53] - [53, 57] + (variable [53, 53] - [53, 57])) + (exp_name [53, 58] - [53, 62] + (variable [53, 58] - [53, 62])))))) + (guard_equation [54, 4] - [54, 76] + (guards [54, 4] - [54, 15] + (guard [54, 6] - [54, 15] + (exp_name [54, 6] - [54, 15] + (variable [54, 6] - [54, 15])))) + (exp_apply [54, 18] - [54, 76] + (exp_name [54, 18] - [54, 33] + (variable [54, 18] - [54, 33])) + (exp_name [54, 34] - [54, 38] + (variable [54, 34] - [54, 38])) + (exp_parens [54, 39] - [54, 76] + (exp_apply [54, 40] - [54, 75] + (exp_name [54, 40] - [54, 49] + (constructor [54, 40] - [54, 49])) + (exp_name [54, 50] - [54, 57] + (variable [54, 50] - [54, 57])) + (exp_parens [54, 58] - [54, 69] + (exp_apply [54, 59] - [54, 68] + (exp_name [54, 59] - [54, 63] + (variable [54, 59] - [54, 63])) + (exp_name [54, 64] - [54, 68] + (variable [54, 64] - [54, 68])))) + (exp_name [54, 70] - [54, 75] + (variable [54, 70] - [54, 75]))))))) + (signature [57, 0] - [57, 62] + name: (variable [57, 0] - [57, 12]) + type: (fun [57, 16] - [57, 62] + (type_list [57, 16] - [57, 24] + (type_name [57, 17] - [57, 23] + (type [57, 17] - [57, 23]))) + (fun [57, 28] - [57, 62] + (type_apply [57, 28] - [57, 43] + (type_name [57, 28] - [57, 33] + (type [57, 28] - [57, 33])) + (type_name [57, 34] - [57, 43] + (type [57, 34] - [57, 43]))) + (type_apply [57, 47] - [57, 62] + (type_name [57, 47] - [57, 52] + (type [57, 47] - [57, 52])) + (type_name [57, 53] - [57, 62] + (type [57, 53] - [57, 62])))))) + (function [58, 0] - [58, 32] + name: (variable [58, 0] - [58, 12]) + patterns: (patterns [58, 13] - [58, 22] + (pat_wildcard [58, 13] - [58, 14]) + (pat_name [58, 15] - [58, 22] + (constructor [58, 15] - [58, 22]))) + rhs: (exp_name [58, 25] - [58, 32] + (constructor [58, 25] - [58, 32]))) + (function [59, 0] - [59, 57] + name: (variable [59, 0] - [59, 12]) + patterns: (patterns [59, 13] - [59, 36] + (pat_literal [59, 13] - [59, 15] + (con_list [59, 13] - [59, 15])) + (pat_parens [59, 16] - [59, 36] + (pat_apply [59, 17] - [59, 35] + (pat_name [59, 17] - [59, 21] + (constructor [59, 17] - [59, 21])) + (pat_name [59, 22] - [59, 35] + (variable [59, 22] - [59, 35]))))) + rhs: (exp_apply [59, 39] - [59, 57] + (exp_name [59, 39] - [59, 43] + (constructor [59, 39] - [59, 43])) + (exp_name [59, 44] - [59, 57] + (variable [59, 44] - [59, 57])))) + (function [60, 0] - [61, 84] + name: (variable [60, 0] - [60, 12]) + patterns: (patterns [60, 13] - [60, 44] + (pat_name [60, 13] - [60, 23] + (variable [60, 13] - [60, 23])) + (pat_parens [60, 24] - [60, 44] + (pat_apply [60, 25] - [60, 43] + (pat_name [60, 25] - [60, 29] + (constructor [60, 25] - [60, 29])) + (pat_name [60, 30] - [60, 43] + (variable [60, 30] - [60, 43]))))) + rhs: (exp_apply [61, 4] - [61, 84] + (exp_name [61, 4] - [61, 16] + (variable [61, 4] - [61, 16])) + (exp_parens [61, 17] - [61, 34] + (exp_apply [61, 18] - [61, 33] + (exp_name [61, 18] - [61, 22] + (variable [61, 18] - [61, 22])) + (exp_name [61, 23] - [61, 33] + (variable [61, 23] - [61, 33])))) + (exp_parens [61, 35] - [61, 84] + (exp_apply [61, 36] - [61, 83] + (exp_name [61, 36] - [61, 51] + (variable [61, 36] - [61, 51])) + (exp_parens [61, 52] - [61, 69] + (exp_apply [61, 53] - [61, 68] + (exp_name [61, 53] - [61, 57] + (variable [61, 53] - [61, 57])) + (exp_name [61, 58] - [61, 68] + (variable [61, 58] - [61, 68])))) + (exp_name [61, 70] - [61, 83] + (variable [61, 70] - [61, 83])))))) + (signature [63, 0] - [63, 57] + name: (variable [63, 0] - [63, 2]) + type: (fun [63, 6] - [63, 57] + (type_name [63, 6] - [63, 12] + (type [63, 6] - [63, 12])) + (fun [63, 16] - [63, 57] + (type_name [63, 16] - [63, 25] + (type [63, 16] - [63, 25])) + (fun [63, 29] - [63, 57] + (type_name [63, 29] - [63, 38] + (type [63, 29] - [63, 38])) + (type_apply [63, 42] - [63, 57] + (type_name [63, 42] - [63, 47] + (type [63, 42] - [63, 47])) + (type_name [63, 48] - [63, 57] + (type [63, 48] - [63, 57]))))))) + (function [64, 0] - [69, 47] + name: (variable [64, 0] - [64, 2]) + patterns: (patterns [64, 3] - [64, 35] + (pat_name [64, 3] - [64, 7] + (variable [64, 3] - [64, 7])) + (pat_name [64, 8] - [64, 21] + (variable [64, 8] - [64, 21])) + (pat_name [64, 22] - [64, 35] + (variable [64, 22] - [64, 35]))) + rhs: (exp_let_in [65, 4] - [69, 47] + (exp_let [65, 4] - [65, 28] + (decls [65, 8] - [65, 28] + (function [65, 8] - [65, 28] + name: (variable [65, 8] - [65, 9]) + rhs: (exp_parens [65, 12] - [65, 28] + (exp_apply [65, 13] - [65, 27] + (exp_name [65, 13] - [65, 22] + (variable [65, 13] - [65, 22])) + (exp_name [65, 23] - [65, 27] + (variable [65, 23] - [65, 27]))))))) + (exp_in [65, 29] - [69, 47] + (exp_cond [66, 8] - [69, 47] + if: (exp_infix [66, 11] - [66, 26] + (exp_parens [66, 11] - [66, 19] + (exp_apply [66, 12] - [66, 18] + (exp_name [66, 12] - [66, 16] + (variable [66, 12] - [66, 16])) + (exp_name [66, 17] - [66, 18] + (variable [66, 17] - [66, 18])))) + (operator [66, 20] - [66, 22]) + (exp_literal [66, 23] - [66, 26] + (string [66, 23] - [66, 26]))) + then: (exp_apply [67, 12] - [67, 54] + (exp_name [67, 12] - [67, 24] + (variable [67, 12] - [67, 24])) + (exp_parens [67, 25] - [67, 33] + (exp_apply [67, 26] - [67, 32] + (exp_name [67, 26] - [67, 30] + (variable [67, 26] - [67, 30])) + (exp_name [67, 31] - [67, 32] + (variable [67, 31] - [67, 32])))) + (exp_parens [67, 34] - [67, 54] + (exp_apply [67, 35] - [67, 53] + (exp_name [67, 35] - [67, 39] + (constructor [67, 35] - [67, 39])) + (exp_name [67, 40] - [67, 53] + (variable [67, 40] - [67, 53]))))) + else: (exp_apply [69, 12] - [69, 47] + (exp_name [69, 12] - [69, 24] + (variable [69, 12] - [69, 24])) + (exp_name [69, 25] - [69, 26] + (variable [69, 25] - [69, 26])) + (exp_parens [69, 27] - [69, 47] + (exp_apply [69, 28] - [69, 46] + (exp_name [69, 28] - [69, 32] + (constructor [69, 28] - [69, 32])) + (exp_name [69, 33] - [69, 46] + (variable [69, 33] - [69, 46]))))))))) + (signature [72, 0] - [72, 57] + name: (variable [72, 0] - [72, 14]) + type: (fun [72, 18] - [72, 57] + (type_apply [72, 18] - [72, 33] + (type_name [72, 18] - [72, 23] + (type [72, 18] - [72, 23])) + (type_name [72, 24] - [72, 33] + (type [72, 24] - [72, 33]))) + (fun [72, 37] - [72, 57] + (type_name [72, 37] - [72, 43] + (type [72, 37] - [72, 43])) + (type_apply [72, 47] - [72, 57] + (type_name [72, 47] - [72, 52] + (type [72, 47] - [72, 52])) + (type_name [72, 53] - [72, 57] + (type [72, 53] - [72, 57])))))) + (function [73, 0] - [73, 79] + name: (variable [73, 0] - [73, 14]) + patterns: (patterns [73, 15] - [73, 52] + (pat_parens [73, 15] - [73, 43] + (pat_apply [73, 16] - [73, 42] + (pat_name [73, 16] - [73, 20] + (constructor [73, 16] - [73, 20])) + (pat_parens [73, 21] - [73, 42] + (pat_apply [73, 22] - [73, 41] + (pat_name [73, 22] - [73, 31] + (constructor [73, 22] - [73, 31])) + (pat_wildcard [73, 32] - [73, 33]) + (pat_wildcard [73, 34] - [73, 35]) + (pat_name [73, 36] - [73, 41] + (variable [73, 36] - [73, 41])))))) + (pat_name [73, 44] - [73, 52] + (variable [73, 44] - [73, 52]))) + rhs: (exp_parens [73, 55] - [73, 79] + (exp_apply [73, 56] - [73, 78] + (exp_name [73, 56] - [73, 63] + (variable [73, 56] - [73, 63])) + (exp_name [73, 64] - [73, 69] + (variable [73, 64] - [73, 69])) + (exp_name [73, 70] - [73, 78] + (variable [73, 70] - [73, 78]))))) + (signature [75, 0] - [75, 58] + name: (variable [75, 0] - [75, 8]) + type: (fun [75, 12] - [75, 58] + (type_name [75, 12] - [75, 18] + (type [75, 12] - [75, 18])) + (fun [75, 22] - [75, 58] + (type_name [75, 22] - [75, 31] + (type [75, 22] - [75, 31])) + (fun [75, 35] - [75, 58] + (type_name [75, 35] - [75, 44] + (type [75, 35] - [75, 44])) + (type_apply [75, 48] - [75, 58] + (type_name [75, 48] - [75, 53] + (type [75, 48] - [75, 53])) + (type_name [75, 54] - [75, 58] + (type [75, 54] - [75, 58]))))))) + (function [76, 0] - [81, 117] + name: (variable [76, 0] - [76, 8]) + patterns: (patterns [76, 9] - [76, 41] + (pat_name [76, 9] - [76, 13] + (variable [76, 9] - [76, 13])) + (pat_name [76, 14] - [76, 27] + (variable [76, 14] - [76, 27])) + (pat_name [76, 28] - [76, 41] + (variable [76, 28] - [76, 41]))) + rhs: (exp_let_in [77, 4] - [81, 117] + (exp_let [77, 4] - [77, 28] + (decls [77, 8] - [77, 28] + (function [77, 8] - [77, 28] + name: (variable [77, 8] - [77, 9]) + rhs: (exp_parens [77, 12] - [77, 28] + (exp_apply [77, 13] - [77, 27] + (exp_name [77, 13] - [77, 22] + (variable [77, 13] - [77, 22])) + (exp_name [77, 23] - [77, 27] + (variable [77, 23] - [77, 27]))))))) + (exp_in [77, 29] - [81, 117] + (exp_cond [78, 8] - [81, 117] + if: (exp_infix [78, 11] - [78, 26] + (exp_parens [78, 11] - [78, 19] + (exp_apply [78, 12] - [78, 18] + (exp_name [78, 12] - [78, 16] + (variable [78, 12] - [78, 16])) + (exp_name [78, 17] - [78, 18] + (variable [78, 17] - [78, 18])))) + (operator [78, 20] - [78, 22]) + (exp_literal [78, 23] - [78, 26] + (string [78, 23] - [78, 26]))) + then: (exp_parens [79, 12] - [79, 116] + (exp_apply [79, 13] - [79, 115] + (exp_name [79, 13] - [79, 27] + (variable [79, 13] - [79, 27])) + (exp_parens [79, 28] - [79, 96] + (exp_apply [79, 29] - [79, 95] + (exp_name [79, 29] - [79, 41] + (variable [79, 29] - [79, 41])) + (exp_parens [79, 42] - [79, 74] + (exp_apply [79, 43] - [79, 73] + (exp_name [79, 43] - [79, 47] + (variable [79, 43] - [79, 47])) + (exp_parens [79, 48] - [79, 64] + (exp_infix [79, 49] - [79, 63] + (exp_parens [79, 49] - [79, 59] + (exp_apply [79, 50] - [79, 58] + (exp_name [79, 50] - [79, 56] + (variable [79, 50] - [79, 56])) + (exp_name [79, 57] - [79, 58] + (variable [79, 57] - [79, 58])))) + (operator [79, 60] - [79, 61]) + (exp_literal [79, 62] - [79, 63] + (integer [79, 62] - [79, 63])))) + (exp_parens [79, 65] - [79, 73] + (exp_apply [79, 66] - [79, 72] + (exp_name [79, 66] - [79, 70] + (variable [79, 66] - [79, 70])) + (exp_name [79, 71] - [79, 72] + (variable [79, 71] - [79, 72])))))) + (exp_parens [79, 75] - [79, 95] + (exp_apply [79, 76] - [79, 94] + (exp_name [79, 76] - [79, 80] + (constructor [79, 76] - [79, 80])) + (exp_name [79, 81] - [79, 94] + (variable [79, 81] - [79, 94])))))) + (exp_parens [79, 97] - [79, 115] + (exp_apply [79, 98] - [79, 114] + (exp_name [79, 98] - [79, 102] + (variable [79, 98] - [79, 102])) + (exp_parens [79, 103] - [79, 114] + (exp_apply [79, 104] - [79, 113] + (exp_name [79, 104] - [79, 111] + (variable [79, 104] - [79, 111])) + (exp_name [79, 112] - [79, 113] + (variable [79, 112] - [79, 113])))))))) + else: (exp_parens [81, 12] - [81, 117] + (exp_apply [81, 13] - [81, 116] + (exp_name [81, 13] - [81, 27] + (variable [81, 13] - [81, 27])) + (exp_parens [81, 28] - [81, 97] + (exp_apply [81, 29] - [81, 96] + (exp_name [81, 29] - [81, 41] + (variable [81, 29] - [81, 41])) + (exp_parens [81, 42] - [81, 75] + (exp_apply [81, 43] - [81, 74] + (exp_name [81, 43] - [81, 47] + (variable [81, 43] - [81, 47])) + (exp_parens [81, 48] - [81, 64] + (exp_infix [81, 49] - [81, 63] + (exp_parens [81, 49] - [81, 59] + (exp_apply [81, 50] - [81, 58] + (exp_name [81, 50] - [81, 56] + (variable [81, 50] - [81, 56])) + (exp_name [81, 57] - [81, 58] + (variable [81, 57] - [81, 58])))) + (operator [81, 60] - [81, 61]) + (exp_literal [81, 62] - [81, 63] + (integer [81, 62] - [81, 63])))) + (exp_parens [81, 65] - [81, 74] + (exp_apply [81, 66] - [81, 72] + (exp_name [81, 66] - [81, 70] + (variable [81, 66] - [81, 70])) + (exp_name [81, 71] - [81, 72] + (variable [81, 71] - [81, 72])))))) + (exp_parens [81, 76] - [81, 96] + (exp_apply [81, 77] - [81, 95] + (exp_name [81, 77] - [81, 81] + (constructor [81, 77] - [81, 81])) + (exp_name [81, 82] - [81, 95] + (variable [81, 82] - [81, 95])))))) + (exp_parens [81, 98] - [81, 116] + (exp_apply [81, 99] - [81, 115] + (exp_name [81, 99] - [81, 103] + (variable [81, 99] - [81, 103])) + (exp_parens [81, 104] - [81, 115] + (exp_apply [81, 105] - [81, 114] + (exp_name [81, 105] - [81, 112] + (variable [81, 105] - [81, 112])) + (exp_name [81, 113] - [81, 114] + (variable [81, 113] - [81, 114])))))))))))) + (signature [83, 0] - [83, 47] + name: (variable [83, 0] - [83, 13]) + type: (fun [83, 17] - [83, 47] + (type_name [83, 17] - [83, 23] + (type [83, 17] - [83, 23])) + (fun [83, 27] - [83, 47] + (type_apply [83, 27] - [83, 37] + (type_name [83, 27] - [83, 32] + (type [83, 27] - [83, 32])) + (type_name [83, 33] - [83, 37] + (type [83, 33] - [83, 37]))) + (type_name [83, 41] - [83, 47] + (type [83, 41] - [83, 47]))))) + (function [84, 0] - [84, 61] + name: (variable [84, 0] - [84, 13]) + patterns: (patterns [84, 14] - [84, 32] + (pat_name [84, 14] - [84, 20] + (variable [84, 14] - [84, 20])) + (pat_parens [84, 21] - [84, 32] + (pat_apply [84, 22] - [84, 31] + (pat_name [84, 22] - [84, 26] + (constructor [84, 22] - [84, 26])) + (pat_name [84, 27] - [84, 31] + (variable [84, 27] - [84, 31]))))) + rhs: (exp_parens [84, 35] - [84, 61] + (exp_infix [84, 36] - [84, 60] + (exp_name [84, 36] - [84, 42] + (variable [84, 36] - [84, 42])) + (operator [84, 43] - [84, 45]) + (exp_parens [84, 46] - [84, 60] + (exp_apply [84, 47] - [84, 59] + (exp_name [84, 47] - [84, 54] + (variable [84, 47] - [84, 54])) + (exp_name [84, 55] - [84, 59] + (variable [84, 55] - [84, 59]))))))) + (signature [86, 0] - [86, 39] + name: (variable [86, 0] - [86, 16]) + type: (fun [86, 20] - [86, 39] + (type_name [86, 20] - [86, 26] + (type [86, 20] - [86, 26])) + (type_apply [86, 30] - [86, 39] + (type_name [86, 30] - [86, 32] + (type [86, 30] - [86, 32])) + (type_name [86, 33] - [86, 39] + (type [86, 33] - [86, 39]))))) + (function [87, 0] - [92, 50] + name: (variable [87, 0] - [87, 16]) + patterns: (patterns [87, 17] - [87, 23] + (pat_name [87, 17] - [87, 23] + (variable [87, 17] - [87, 23]))) + rhs: (exp_do [87, 26] - [92, 50] + (stmt [88, 4] - [88, 20] + (bind_pattern [88, 4] - [88, 20] + (pat_name [88, 4] - [88, 9] + (variable [88, 4] - [88, 9])) + (exp_name [88, 13] - [88, 20] + (variable [88, 13] - [88, 20])))) + (stmt [89, 4] - [92, 50] + (exp_cond [89, 4] - [92, 50] + if: (exp_infix [89, 7] - [89, 19] + (exp_name [89, 7] - [89, 12] + (variable [89, 7] - [89, 12])) + (operator [89, 13] - [89, 15]) + (exp_literal [89, 16] - [89, 19] + (string [89, 16] - [89, 19]))) + then: (exp_apply [90, 8] - [90, 21] + (exp_name [90, 8] - [90, 14] + (variable [90, 8] - [90, 14])) + (exp_name [90, 15] - [90, 21] + (variable [90, 15] - [90, 21]))) + else: (exp_apply [92, 8] - [92, 50] + (exp_name [92, 8] - [92, 24] + (variable [92, 8] - [92, 24])) + (exp_parens [92, 25] - [92, 50] + (exp_infix [92, 26] - [92, 49] + (exp_infix [92, 26] - [92, 41] + (exp_name [92, 26] - [92, 32] + (variable [92, 26] - [92, 32])) + (operator [92, 33] - [92, 35]) + (exp_name [92, 36] - [92, 41] + (variable [92, 36] - [92, 41]))) + (operator [92, 42] - [92, 44]) + (exp_literal [92, 45] - [92, 49] + (string [92, 45] - [92, 49]))))))))) + (signature [94, 0] - [94, 59] + name: (variable [94, 0] - [94, 13]) + type: (fun [94, 17] - [94, 59] + (type_name [94, 17] - [94, 23] + (type [94, 17] - [94, 23])) + (fun [94, 27] - [94, 59] + (type_name [94, 27] - [94, 33] + (type [94, 27] - [94, 33])) + (fun [94, 37] - [94, 59] + (type_name [94, 37] - [94, 46] + (type [94, 37] - [94, 46])) + (type_name [94, 50] - [94, 59] + (type [94, 50] - [94, 59])))))) + (function [95, 0] - [98, 59] + name: (variable [95, 0] - [95, 13]) + patterns: (patterns [95, 14] - [95, 48] + (pat_name [95, 14] - [95, 22] + (variable [95, 14] - [95, 22])) + (pat_name [95, 23] - [95, 34] + (variable [95, 23] - [95, 34])) + (pat_name [95, 35] - [95, 48] + (variable [95, 35] - [95, 48]))) + rhs: (exp_cond [95, 51] - [98, 59] + if: (exp_infix [95, 54] - [95, 105] + (exp_parens [95, 54] - [95, 94] + (exp_apply [95, 55] - [95, 93] + (exp_name [95, 55] - [95, 62] + (variable [95, 55] - [95, 62])) + (exp_parens [95, 63] - [95, 84] + (exp_apply [95, 64] - [95, 83] + (exp_name [95, 64] - [95, 69] + (variable [95, 64] - [95, 69])) + (exp_name [95, 70] - [95, 83] + (variable [95, 70] - [95, 83])))) + (exp_name [95, 85] - [95, 93] + (variable [95, 85] - [95, 93])))) + (operator [95, 95] - [95, 97]) + (exp_name [95, 98] - [95, 105] + (constructor [95, 98] - [95, 105]))) + then: (exp_parens [96, 8] - [96, 73] + (exp_apply [96, 9] - [96, 72] + (exp_name [96, 9] - [96, 16] + (variable [96, 9] - [96, 16])) + (exp_parens [96, 17] - [96, 44] + (exp_apply [96, 18] - [96, 43] + (exp_name [96, 18] - [96, 22] + (constructor [96, 18] - [96, 22])) + (exp_name [96, 23] - [96, 31] + (variable [96, 23] - [96, 31])) + (exp_name [96, 32] - [96, 43] + (variable [96, 32] - [96, 43])))) + (exp_parens [96, 45] - [96, 72] + (exp_apply [96, 46] - [96, 71] + (exp_name [96, 46] - [96, 48] + (variable [96, 46] - [96, 48])) + (exp_name [96, 49] - [96, 57] + (variable [96, 49] - [96, 57])) + (exp_name [96, 58] - [96, 71] + (variable [96, 58] - [96, 71])))))) + else: (exp_parens [98, 8] - [98, 59] + (exp_apply [98, 9] - [98, 58] + (exp_name [98, 9] - [98, 16] + (variable [98, 9] - [98, 16])) + (exp_parens [98, 17] - [98, 44] + (exp_apply [98, 18] - [98, 43] + (exp_name [98, 18] - [98, 22] + (constructor [98, 18] - [98, 22])) + (exp_name [98, 23] - [98, 31] + (variable [98, 23] - [98, 31])) + (exp_name [98, 32] - [98, 43] + (variable [98, 32] - [98, 43])))) + (exp_name [98, 45] - [98, 58] + (variable [98, 45] - [98, 58])))))) + (signature [100, 0] - [100, 85] + name: (variable [100, 0] - [100, 18]) + type: (fun [100, 22] - [100, 85] + (type_list [100, 22] - [100, 30] + (type_name [100, 23] - [100, 29] + (type [100, 23] - [100, 29]))) + (fun [100, 34] - [100, 85] + (type_name [100, 34] - [100, 40] + (type [100, 34] - [100, 40])) + (fun [100, 44] - [100, 85] + (type_name [100, 44] - [100, 53] + (type [100, 44] - [100, 53])) + (fun [100, 57] - [100, 85] + (type_name [100, 57] - [100, 66] + (type [100, 57] - [100, 66])) + (fun [100, 70] - [100, 85] + (type_name [100, 70] - [100, 76] + (type [100, 70] - [100, 76])) + (type_apply [100, 80] - [100, 85] + (type_name [100, 80] - [100, 82] + (type [100, 80] - [100, 82])) + (type_literal [100, 83] - [100, 85] + (con_unit [100, 83] - [100, 85]))))))))) + (function [101, 0] - [107, 68] + name: (variable [101, 0] - [101, 18]) + patterns: (patterns [101, 19] - [101, 64] + (pat_name [101, 19] - [101, 24] + (variable [101, 19] - [101, 24])) + (pat_name [101, 25] - [101, 29] + (variable [101, 25] - [101, 29])) + (pat_name [101, 30] - [101, 43] + (variable [101, 30] - [101, 43])) + (pat_name [101, 44] - [101, 57] + (variable [101, 44] - [101, 57])) + (pat_name [101, 58] - [101, 64] + (variable [101, 58] - [101, 64]))) + rhs: (exp_do [101, 67] - [107, 68] + (stmt [102, 4] - [102, 82] + (let [102, 4] - [102, 82] + (decls [102, 8] - [102, 82] + (function [102, 8] - [102, 31] + name: (variable [102, 8] - [102, 16]) + rhs: (exp_parens [102, 19] - [102, 31] + (exp_apply [102, 20] - [102, 30] + (exp_name [102, 20] - [102, 24] + (variable [102, 20] - [102, 24])) + (exp_name [102, 25] - [102, 30] + (variable [102, 25] - [102, 30]))))) + (comment [102, 31] - [102, 82])))) + (stmt [103, 4] - [103, 40] + (bind_pattern [103, 4] - [103, 40] + (pat_name [103, 4] - [103, 15] + (variable [103, 4] - [103, 15])) + (exp_parens [103, 19] - [103, 40] + (exp_apply [103, 20] - [103, 39] + (exp_name [103, 20] - [103, 36] + (variable [103, 20] - [103, 36])) + (exp_literal [103, 37] - [103, 39] + (string [103, 37] - [103, 39])))))) + (stmt [104, 4] - [104, 66] + (let [104, 4] - [104, 66] + (decls [104, 8] - [104, 66] + (function [104, 8] - [104, 66] + name: (variable [104, 8] - [104, 15]) + rhs: (exp_apply [104, 18] - [104, 66] + (exp_name [104, 18] - [104, 31] + (variable [104, 18] - [104, 31])) + (exp_name [104, 32] - [104, 40] + (variable [104, 32] - [104, 40])) + (exp_name [104, 41] - [104, 52] + (variable [104, 41] - [104, 52])) + (exp_name [104, 53] - [104, 66] + (variable [104, 53] - [104, 66]))))))) + (stmt [105, 4] - [105, 27] + (exp_apply [105, 4] - [105, 27] + (exp_name [105, 4] - [105, 12] + (variable [105, 4] - [105, 12])) + (exp_parens [105, 13] - [105, 27] + (exp_apply [105, 14] - [105, 26] + (exp_name [105, 14] - [105, 18] + (variable [105, 14] - [105, 18])) + (exp_name [105, 19] - [105, 26] + (variable [105, 19] - [105, 26])))))) + (stmt [106, 4] - [106, 88] + (let [106, 4] - [106, 88] + (decls [106, 8] - [106, 88] + (function [106, 8] - [106, 88] + pattern: (pat_parens [106, 8] - [106, 22] + (pat_apply [106, 9] - [106, 21] + (pat_name [106, 9] - [106, 13] + (constructor [106, 9] - [106, 13])) + (pat_name [106, 14] - [106, 21] + (variable [106, 14] - [106, 21])))) + rhs: (exp_parens [106, 25] - [106, 88] + (exp_apply [106, 26] - [106, 87] + (exp_name [106, 26] - [106, 41] + (variable [106, 26] - [106, 41])) + (exp_parens [106, 42] - [106, 62] + (exp_apply [106, 43] - [106, 61] + (exp_name [106, 43] - [106, 47] + (constructor [106, 43] - [106, 47])) + (exp_name [106, 48] - [106, 61] + (variable [106, 48] - [106, 61])))) + (exp_parens [106, 63] - [106, 79] + (exp_apply [106, 64] - [106, 78] + (exp_name [106, 64] - [106, 73] + (variable [106, 64] - [106, 73])) + (exp_name [106, 74] - [106, 78] + (variable [106, 74] - [106, 78])))) + (exp_name [106, 80] - [106, 87] + (variable [106, 80] - [106, 87])))))))) + (stmt [107, 4] - [107, 68] + (exp_apply [107, 4] - [107, 68] + (exp_name [107, 4] - [107, 22] + (variable [107, 4] - [107, 22])) + (exp_parens [107, 23] - [107, 37] + (exp_apply [107, 24] - [107, 36] + (exp_name [107, 24] - [107, 28] + (constructor [107, 24] - [107, 28])) + (exp_name [107, 29] - [107, 36] + (variable [107, 29] - [107, 36])))) + (exp_name [107, 38] - [107, 42] + (variable [107, 38] - [107, 42])) + (exp_parens [107, 43] - [107, 68] + (exp_apply [107, 44] - [107, 67] + (exp_name [107, 44] - [107, 46] + (variable [107, 44] - [107, 46])) + (exp_name [107, 47] - [107, 51] + (variable [107, 47] - [107, 51])) + (exp_name [107, 52] - [107, 59] + (variable [107, 52] - [107, 59])) + (exp_name [107, 60] - [107, 67] + (variable [107, 60] - [107, 67])))))))) + (signature [109, 0] - [109, 86] + name: (variable [109, 0] - [109, 19]) + type: (fun [109, 23] - [109, 86] + (type_list [109, 23] - [109, 31] + (type_name [109, 24] - [109, 30] + (type [109, 24] - [109, 30]))) + (fun [109, 35] - [109, 86] + (type_name [109, 35] - [109, 41] + (type [109, 35] - [109, 41])) + (fun [109, 45] - [109, 86] + (type_name [109, 45] - [109, 54] + (type [109, 45] - [109, 54])) + (fun [109, 58] - [109, 86] + (type_name [109, 58] - [109, 67] + (type [109, 58] - [109, 67])) + (fun [109, 71] - [109, 86] + (type_name [109, 71] - [109, 77] + (type [109, 71] - [109, 77])) + (type_apply [109, 81] - [109, 86] + (type_name [109, 81] - [109, 83] + (type [109, 81] - [109, 83])) + (type_literal [109, 84] - [109, 86] + (con_unit [109, 84] - [109, 86]))))))))) + (function [110, 0] - [114, 68] + name: (variable [110, 0] - [110, 19]) + patterns: (patterns [110, 20] - [110, 65] + (pat_name [110, 20] - [110, 25] + (variable [110, 20] - [110, 25])) + (pat_name [110, 26] - [110, 30] + (variable [110, 26] - [110, 30])) + (pat_name [110, 31] - [110, 44] + (variable [110, 31] - [110, 44])) + (pat_name [110, 45] - [110, 58] + (variable [110, 45] - [110, 58])) + (pat_name [110, 59] - [110, 65] + (variable [110, 59] - [110, 65]))) + rhs: (exp_do [110, 68] - [114, 68] + (stmt [111, 4] - [111, 67] + (let [111, 4] - [111, 67] + (decls [111, 8] - [111, 67] + (function [111, 8] - [111, 31] + name: (variable [111, 8] - [111, 16]) + rhs: (exp_parens [111, 19] - [111, 31] + (exp_apply [111, 20] - [111, 30] + (exp_name [111, 20] - [111, 24] + (variable [111, 20] - [111, 24])) + (exp_name [111, 25] - [111, 30] + (variable [111, 25] - [111, 30]))))) + (comment [111, 31] - [111, 67])))) + (stmt [112, 4] - [112, 124] + (let [112, 4] - [112, 124] + (decls [112, 8] - [112, 124] + (function [112, 8] - [112, 61] + name: (variable [112, 8] - [112, 15]) + rhs: (exp_apply [112, 18] - [112, 61] + (exp_name [112, 18] - [112, 31] + (variable [112, 18] - [112, 31])) + (exp_name [112, 32] - [112, 40] + (variable [112, 32] - [112, 40])) + (exp_name [112, 41] - [112, 47] + (variable [112, 41] - [112, 47])) + (exp_name [112, 48] - [112, 61] + (variable [112, 48] - [112, 61])))) + (comment [112, 61] - [112, 124])))) + (stmt [113, 4] - [113, 88] + (let [113, 4] - [113, 88] + (decls [113, 8] - [113, 88] + (function [113, 8] - [113, 88] + pattern: (pat_parens [113, 8] - [113, 22] + (pat_apply [113, 9] - [113, 21] + (pat_name [113, 9] - [113, 13] + (constructor [113, 9] - [113, 13])) + (pat_name [113, 14] - [113, 21] + (variable [113, 14] - [113, 21])))) + rhs: (exp_parens [113, 25] - [113, 88] + (exp_apply [113, 26] - [113, 87] + (exp_name [113, 26] - [113, 41] + (variable [113, 26] - [113, 41])) + (exp_parens [113, 42] - [113, 62] + (exp_apply [113, 43] - [113, 61] + (exp_name [113, 43] - [113, 47] + (constructor [113, 43] - [113, 47])) + (exp_name [113, 48] - [113, 61] + (variable [113, 48] - [113, 61])))) + (exp_parens [113, 63] - [113, 79] + (exp_apply [113, 64] - [113, 78] + (exp_name [113, 64] - [113, 73] + (variable [113, 64] - [113, 73])) + (exp_name [113, 74] - [113, 78] + (variable [113, 74] - [113, 78])))) + (exp_name [113, 80] - [113, 87] + (variable [113, 80] - [113, 87])))))))) + (stmt [114, 4] - [114, 68] + (exp_apply [114, 4] - [114, 68] + (exp_name [114, 4] - [114, 22] + (variable [114, 4] - [114, 22])) + (exp_parens [114, 23] - [114, 37] + (exp_apply [114, 24] - [114, 36] + (exp_name [114, 24] - [114, 28] + (constructor [114, 24] - [114, 28])) + (exp_name [114, 29] - [114, 36] + (variable [114, 29] - [114, 36])))) + (exp_name [114, 38] - [114, 42] + (variable [114, 38] - [114, 42])) + (exp_parens [114, 43] - [114, 68] + (exp_apply [114, 44] - [114, 67] + (exp_name [114, 44] - [114, 46] + (variable [114, 44] - [114, 46])) + (exp_name [114, 47] - [114, 51] + (variable [114, 47] - [114, 51])) + (exp_name [114, 52] - [114, 59] + (variable [114, 52] - [114, 59])) + (exp_name [114, 60] - [114, 67] + (variable [114, 60] - [114, 67])))))))) + (signature [116, 0] - [116, 70] + name: (variable [116, 0] - [116, 3]) + type: (fun [116, 7] - [116, 70] + (type_list [116, 7] - [116, 15] + (type_name [116, 8] - [116, 14] + (type [116, 8] - [116, 14]))) + (fun [116, 19] - [116, 70] + (type_name [116, 19] - [116, 25] + (type [116, 19] - [116, 25])) + (fun [116, 29] - [116, 70] + (type_name [116, 29] - [116, 38] + (type [116, 29] - [116, 38])) + (fun [116, 42] - [116, 70] + (type_name [116, 42] - [116, 51] + (type [116, 42] - [116, 51])) + (fun [116, 55] - [116, 70] + (type_name [116, 55] - [116, 61] + (type [116, 55] - [116, 61])) + (type_apply [116, 65] - [116, 70] + (type_name [116, 65] - [116, 67] + (type [116, 65] - [116, 67])) + (type_literal [116, 68] - [116, 70] + (con_unit [116, 68] - [116, 70]))))))))) + (function [117, 0] - [124, 142] + name: (variable [117, 0] - [117, 3]) + patterns: (patterns [117, 4] - [117, 49] + (pat_name [117, 4] - [117, 9] + (variable [117, 4] - [117, 9])) + (pat_name [117, 10] - [117, 14] + (variable [117, 10] - [117, 14])) + (pat_name [117, 15] - [117, 28] + (variable [117, 15] - [117, 28])) + (pat_name [117, 29] - [117, 42] + (variable [117, 29] - [117, 42])) + (pat_name [117, 43] - [117, 49] + (variable [117, 43] - [117, 49]))) + (guard_equation [118, 4] - [119, 104] + (guards [118, 4] - [118, 70] + (guard [118, 6] - [118, 70] + (exp_infix [118, 6] - [118, 70] + (exp_infix [118, 6] - [118, 52] + (exp_parens [118, 6] - [118, 27] + (exp_infix [118, 7] - [118, 26] + (exp_parens [118, 7] - [118, 21] + (exp_apply [118, 8] - [118, 20] + (exp_name [118, 8] - [118, 14] + (variable [118, 8] - [118, 14])) + (exp_name [118, 15] - [118, 20] + (variable [118, 15] - [118, 20])))) + (operator [118, 22] - [118, 24]) + (exp_literal [118, 25] - [118, 26] + (integer [118, 25] - [118, 26])))) + (operator [118, 28] - [118, 30]) + (exp_parens [118, 31] - [118, 52] + (exp_infix [118, 32] - [118, 51] + (exp_parens [118, 32] - [118, 44] + (exp_apply [118, 33] - [118, 43] + (exp_name [118, 33] - [118, 37] + (variable [118, 33] - [118, 37])) + (exp_name [118, 38] - [118, 43] + (variable [118, 38] - [118, 43])))) + (operator [118, 45] - [118, 47]) + (exp_literal [118, 48] - [118, 51] + (string [118, 48] - [118, 51]))))) + (operator [118, 53] - [118, 55]) + (exp_parens [118, 56] - [118, 70] + (exp_infix [118, 57] - [118, 69] + (exp_name [118, 57] - [118, 63] + (variable [118, 57] - [118, 63])) + (operator [118, 64] - [118, 66]) + (exp_literal [118, 67] - [118, 69] + (string [118, 67] - [118, 69]))))))) + (exp_let_in [119, 8] - [119, 104] + (exp_let [119, 8] - [119, 77] + (decls [119, 12] - [119, 77] + (function [119, 12] - [119, 77] + pattern: (pat_parens [119, 12] - [119, 23] + (pat_apply [119, 13] - [119, 22] + (pat_name [119, 13] - [119, 17] + (constructor [119, 13] - [119, 17])) + (pat_name [119, 18] - [119, 22] + (variable [119, 18] - [119, 22])))) + rhs: (exp_parens [119, 26] - [119, 77] + (exp_apply [119, 27] - [119, 76] + (exp_name [119, 27] - [119, 35] + (variable [119, 27] - [119, 35])) + (exp_parens [119, 36] - [119, 48] + (exp_apply [119, 37] - [119, 47] + (exp_name [119, 37] - [119, 41] + (variable [119, 37] - [119, 41])) + (exp_name [119, 42] - [119, 47] + (variable [119, 42] - [119, 47])))) + (exp_name [119, 49] - [119, 62] + (variable [119, 49] - [119, 62])) + (exp_name [119, 63] - [119, 76] + (variable [119, 63] - [119, 76]))))))) + (exp_in [119, 78] - [119, 104] + (exp_apply [119, 81] - [119, 104] + (exp_name [119, 81] - [119, 89] + (variable [119, 81] - [119, 89])) + (exp_parens [119, 90] - [119, 104] + (exp_apply [119, 91] - [119, 103] + (exp_name [119, 91] - [119, 98] + (variable [119, 91] - [119, 98])) + (exp_name [119, 99] - [119, 103] + (variable [119, 99] - [119, 103])))))))) + (guard_equation [120, 4] - [121, 80] + (guards [120, 4] - [120, 41] + (guard [120, 6] - [120, 41] + (exp_infix [120, 6] - [120, 41] + (exp_infix [120, 6] - [120, 35] + (exp_infix [120, 6] - [120, 25] + (exp_parens [120, 6] - [120, 18] + (exp_apply [120, 7] - [120, 17] + (exp_name [120, 7] - [120, 11] + (variable [120, 7] - [120, 11])) + (exp_name [120, 12] - [120, 17] + (variable [120, 12] - [120, 17])))) + (operator [120, 19] - [120, 21]) + (exp_literal [120, 22] - [120, 25] + (string [120, 22] - [120, 25]))) + (operator [120, 26] - [120, 28]) + (exp_name [120, 29] - [120, 35] + (variable [120, 29] - [120, 35]))) + (operator [120, 36] - [120, 38]) + (exp_literal [120, 39] - [120, 41] + (string [120, 39] - [120, 41]))))) + (exp_apply [121, 8] - [121, 80] + (exp_name [121, 8] - [121, 27] + (variable [121, 8] - [121, 27])) + (exp_parens [121, 28] - [121, 40] + (exp_apply [121, 29] - [121, 39] + (exp_name [121, 29] - [121, 33] + (variable [121, 29] - [121, 33])) + (exp_name [121, 34] - [121, 39] + (variable [121, 34] - [121, 39])))) + (exp_name [121, 41] - [121, 45] + (variable [121, 41] - [121, 45])) + (exp_name [121, 46] - [121, 59] + (variable [121, 46] - [121, 59])) + (exp_name [121, 60] - [121, 73] + (variable [121, 60] - [121, 73])) + (exp_name [121, 74] - [121, 80] + (variable [121, 74] - [121, 80])))) + (guard_equation [122, 4] - [123, 79] + (guards [122, 4] - [122, 41] + (guard [122, 6] - [122, 41] + (exp_infix [122, 6] - [122, 41] + (exp_infix [122, 6] - [122, 35] + (exp_infix [122, 6] - [122, 25] + (exp_parens [122, 6] - [122, 18] + (exp_apply [122, 7] - [122, 17] + (exp_name [122, 7] - [122, 11] + (variable [122, 7] - [122, 11])) + (exp_name [122, 12] - [122, 17] + (variable [122, 12] - [122, 17])))) + (operator [122, 19] - [122, 21]) + (exp_literal [122, 22] - [122, 25] + (string [122, 22] - [122, 25]))) + (operator [122, 26] - [122, 28]) + (exp_name [122, 29] - [122, 35] + (variable [122, 29] - [122, 35]))) + (operator [122, 36] - [122, 38]) + (exp_literal [122, 39] - [122, 41] + (string [122, 39] - [122, 41]))))) + (exp_apply [123, 8] - [123, 79] + (exp_name [123, 8] - [123, 26] + (variable [123, 8] - [123, 26])) + (exp_parens [123, 27] - [123, 39] + (exp_apply [123, 28] - [123, 38] + (exp_name [123, 28] - [123, 32] + (variable [123, 28] - [123, 32])) + (exp_name [123, 33] - [123, 38] + (variable [123, 33] - [123, 38])))) + (exp_name [123, 40] - [123, 44] + (variable [123, 40] - [123, 44])) + (exp_name [123, 45] - [123, 58] + (variable [123, 45] - [123, 58])) + (exp_name [123, 59] - [123, 72] + (variable [123, 59] - [123, 72])) + (exp_name [123, 73] - [123, 79] + (variable [123, 73] - [123, 79])))) + (guard_equation [124, 4] - [124, 142] + (guards [124, 4] - [124, 15] + (guard [124, 6] - [124, 15] + (exp_name [124, 6] - [124, 15] + (variable [124, 6] - [124, 15])))) + (exp_apply [124, 18] - [124, 142] + (exp_name [124, 18] - [124, 21] + (variable [124, 18] - [124, 21])) + (exp_parens [124, 22] - [124, 34] + (exp_apply [124, 23] - [124, 33] + (exp_name [124, 23] - [124, 27] + (variable [124, 23] - [124, 27])) + (exp_name [124, 28] - [124, 33] + (variable [124, 28] - [124, 33])))) + (exp_name [124, 35] - [124, 39] + (variable [124, 35] - [124, 39])) + (exp_name [124, 40] - [124, 53] + (variable [124, 40] - [124, 53])) + (exp_name [124, 54] - [124, 67] + (variable [124, 54] - [124, 67])) + (exp_parens [124, 68] - [124, 142] + (exp_apply [124, 69] - [124, 141] + (exp_name [124, 69] - [124, 82] + (variable [124, 69] - [124, 82])) + (exp_name [124, 83] - [124, 89] + (variable [124, 83] - [124, 89])) + (exp_parens [124, 90] - [124, 141] + (exp_apply [124, 91] - [124, 140] + (exp_name [124, 91] - [124, 99] + (variable [124, 91] - [124, 99])) + (exp_parens [124, 100] - [124, 112] + (exp_apply [124, 101] - [124, 111] + (exp_name [124, 101] - [124, 105] + (variable [124, 101] - [124, 105])) + (exp_name [124, 106] - [124, 111] + (variable [124, 106] - [124, 111])))) + (exp_name [124, 113] - [124, 126] + (variable [124, 113] - [124, 126])) + (exp_name [124, 127] - [124, 140] + (variable [124, 127] - [124, 140]))))))))) + (signature [126, 0] - [126, 41] + name: (variable [126, 0] - [126, 5]) + type: (fun [126, 9] - [126, 41] + (type_name [126, 9] - [126, 15] + (type [126, 9] - [126, 15])) + (fun [126, 19] - [126, 41] + (type_name [126, 19] - [126, 28] + (type [126, 19] - [126, 28])) + (type_name [126, 32] - [126, 41] + (type [126, 32] - [126, 41]))))) + (function [127, 0] - [127, 65] + name: (variable [127, 0] - [127, 5]) + patterns: (patterns [127, 6] - [127, 24] + (pat_name [127, 6] - [127, 10] + (variable [127, 6] - [127, 10])) + (pat_name [127, 11] - [127, 24] + (variable [127, 11] - [127, 24]))) + rhs: (exp_apply [127, 27] - [127, 65] + (exp_name [127, 27] - [127, 39] + (variable [127, 27] - [127, 39])) + (exp_parens [127, 40] - [127, 60] + (exp_apply [127, 41] - [127, 59] + (exp_name [127, 41] - [127, 45] + (constructor [127, 41] - [127, 45])) + (exp_name [127, 46] - [127, 59] + (variable [127, 46] - [127, 59])))) + (exp_name [127, 61] - [127, 65] + (variable [127, 61] - [127, 65])))) + (signature [129, 0] - [129, 45] + name: (variable [129, 0] - [129, 10]) + type: (fun [129, 14] - [129, 45] + (type_list [129, 14] - [129, 25] + (type_name [129, 15] - [129, 24] + (type [129, 15] - [129, 24]))) + (fun [129, 29] - [129, 45] + (type_name [129, 29] - [129, 35] + (type [129, 29] - [129, 35])) + (type_name [129, 39] - [129, 45] + (type [129, 39] - [129, 45]))))) + (function [130, 0] - [130, 29] + name: (variable [130, 0] - [130, 10]) + patterns: (patterns [130, 11] - [130, 20] + (pat_literal [130, 11] - [130, 13] + (con_list [130, 11] - [130, 13])) + (pat_name [130, 14] - [130, 20] + (variable [130, 14] - [130, 20]))) + rhs: (exp_name [130, 23] - [130, 29] + (variable [130, 23] - [130, 29]))) + (function [131, 0] - [131, 88] + name: (variable [131, 0] - [131, 10]) + patterns: (patterns [131, 11] - [131, 22] + (pat_name [131, 11] - [131, 15] + (variable [131, 11] - [131, 15])) + (pat_name [131, 16] - [131, 22] + (variable [131, 16] - [131, 22]))) + rhs: (exp_apply [131, 25] - [131, 88] + (exp_name [131, 25] - [131, 35] + (variable [131, 25] - [131, 35])) + (exp_parens [131, 36] - [131, 47] + (exp_apply [131, 37] - [131, 46] + (exp_name [131, 37] - [131, 41] + (variable [131, 37] - [131, 41])) + (exp_name [131, 42] - [131, 46] + (variable [131, 42] - [131, 46])))) + (exp_parens [131, 48] - [131, 88] + (exp_infix [131, 49] - [131, 87] + (exp_infix [131, 49] - [131, 80] + (exp_name [131, 49] - [131, 55] + (variable [131, 49] - [131, 55])) + (operator [131, 56] - [131, 58]) + (exp_parens [131, 59] - [131, 80] + (exp_apply [131, 60] - [131, 79] + (exp_name [131, 60] - [131, 67] + (variable [131, 60] - [131, 67])) + (exp_parens [131, 68] - [131, 79] + (exp_apply [131, 69] - [131, 78] + (exp_name [131, 69] - [131, 73] + (variable [131, 69] - [131, 73])) + (exp_name [131, 74] - [131, 78] + (variable [131, 74] - [131, 78]))))))) + (operator [131, 81] - [131, 83]) + (exp_literal [131, 84] - [131, 87] + (string [131, 84] - [131, 87])))))) + (signature [133, 0] - [133, 41] + name: (variable [133, 0] - [133, 11]) + type: (fun [133, 15] - [133, 41] + (type_list [133, 15] - [133, 21] + (type_name [133, 16] - [133, 20] + (type [133, 16] - [133, 20]))) + (fun [133, 25] - [133, 41] + (type_name [133, 25] - [133, 31] + (type [133, 25] - [133, 31])) + (type_name [133, 35] - [133, 41] + (type [133, 35] - [133, 41]))))) + (function [134, 0] - [134, 30] + name: (variable [134, 0] - [134, 11]) + patterns: (patterns [134, 12] - [134, 21] + (pat_literal [134, 12] - [134, 14] + (con_list [134, 12] - [134, 14])) + (pat_name [134, 15] - [134, 21] + (variable [134, 15] - [134, 21]))) + rhs: (exp_name [134, 24] - [134, 30] + (variable [134, 24] - [134, 30]))) + (function [135, 0] - [135, 94] + name: (variable [135, 0] - [135, 11]) + patterns: (patterns [135, 12] - [135, 24] + (pat_name [135, 12] - [135, 17] + (variable [135, 12] - [135, 17])) + (pat_name [135, 18] - [135, 24] + (variable [135, 18] - [135, 24]))) + rhs: (exp_apply [135, 27] - [135, 94] + (exp_name [135, 27] - [135, 38] + (variable [135, 27] - [135, 38])) + (exp_parens [135, 39] - [135, 51] + (exp_apply [135, 40] - [135, 50] + (exp_name [135, 40] - [135, 44] + (variable [135, 40] - [135, 44])) + (exp_name [135, 45] - [135, 50] + (variable [135, 45] - [135, 50])))) + (exp_parens [135, 52] - [135, 94] + (exp_infix [135, 53] - [135, 93] + (exp_infix [135, 53] - [135, 86] + (exp_name [135, 53] - [135, 59] + (variable [135, 53] - [135, 59])) + (operator [135, 60] - [135, 62]) + (exp_parens [135, 63] - [135, 86] + (exp_apply [135, 64] - [135, 85] + (exp_name [135, 64] - [135, 72] + (variable [135, 64] - [135, 72])) + (exp_parens [135, 73] - [135, 85] + (exp_apply [135, 74] - [135, 84] + (exp_name [135, 74] - [135, 78] + (variable [135, 74] - [135, 78])) + (exp_name [135, 79] - [135, 84] + (variable [135, 79] - [135, 84]))))))) + (operator [135, 87] - [135, 89]) + (exp_literal [135, 90] - [135, 93] + (string [135, 90] - [135, 93])))))) + (signature [137, 0] - [137, 64] + name: (variable [137, 0] - [137, 22]) + type: (fun [137, 26] - [137, 64] + (type_list [137, 26] - [137, 34] + (type_name [137, 27] - [137, 33] + (type [137, 27] - [137, 33]))) + (fun [137, 38] - [137, 64] + (type_name [137, 38] - [137, 44] + (type [137, 38] - [137, 44])) + (fun [137, 48] - [137, 64] + (type_name [137, 48] - [137, 54] + (type [137, 48] - [137, 54])) + (type_name [137, 58] - [137, 64] + (type [137, 58] - [137, 64])))))) + (function [138, 0] - [138, 43] + name: (variable [138, 0] - [138, 22]) + patterns: (patterns [138, 23] - [138, 34] + (pat_literal [138, 23] - [138, 25] + (con_list [138, 23] - [138, 25])) + (pat_wildcard [138, 26] - [138, 27]) + (pat_name [138, 28] - [138, 34] + (variable [138, 28] - [138, 34]))) + rhs: (exp_name [138, 37] - [138, 43] + (variable [138, 37] - [138, 43]))) + (function [139, 0] - [139, 146] + name: (variable [139, 0] - [139, 22]) + patterns: (patterns [139, 23] - [139, 50] + (pat_name [139, 23] - [139, 33] + (variable [139, 23] - [139, 33])) + (pat_name [139, 34] - [139, 43] + (variable [139, 34] - [139, 43])) + (pat_name [139, 44] - [139, 50] + (variable [139, 44] - [139, 50]))) + rhs: (exp_apply [139, 53] - [139, 146] + (exp_name [139, 53] - [139, 75] + (variable [139, 53] - [139, 75])) + (exp_parens [139, 76] - [139, 93] + (exp_apply [139, 77] - [139, 92] + (exp_name [139, 77] - [139, 81] + (variable [139, 77] - [139, 81])) + (exp_name [139, 82] - [139, 92] + (variable [139, 82] - [139, 92])))) + (exp_name [139, 94] - [139, 103] + (variable [139, 94] - [139, 103])) + (exp_parens [139, 104] - [139, 146] + (exp_infix [139, 105] - [139, 145] + (exp_infix [139, 105] - [139, 124] + (exp_name [139, 105] - [139, 111] + (variable [139, 105] - [139, 111])) + (operator [139, 112] - [139, 114]) + (exp_name [139, 115] - [139, 124] + (variable [139, 115] - [139, 124]))) + (operator [139, 125] - [139, 127]) + (exp_parens [139, 128] - [139, 145] + (exp_apply [139, 129] - [139, 144] + (exp_name [139, 129] - [139, 133] + (variable [139, 129] - [139, 133])) + (exp_name [139, 134] - [139, 144] + (variable [139, 134] - [139, 144])))))))) + (signature [141, 0] - [141, 48] + name: (variable [141, 0] - [141, 16]) + type: (fun [141, 20] - [141, 48] + (type_list [141, 20] - [141, 28] + (type_name [141, 21] - [141, 27] + (type [141, 21] - [141, 27]))) + (fun [141, 32] - [141, 48] + (type_name [141, 32] - [141, 38] + (type [141, 32] - [141, 38])) + (type_name [141, 42] - [141, 48] + (type [141, 42] - [141, 48]))))) + (function [142, 0] - [142, 86] + name: (variable [142, 0] - [142, 16]) + patterns: (patterns [142, 17] - [142, 37] + (pat_name [142, 17] - [142, 27] + (variable [142, 17] - [142, 27])) + (pat_name [142, 28] - [142, 37] + (variable [142, 28] - [142, 37]))) + rhs: (exp_apply [142, 40] - [142, 86] + (exp_name [142, 40] - [142, 62] + (variable [142, 40] - [142, 62])) + (exp_name [142, 63] - [142, 73] + (variable [142, 63] - [142, 73])) + (exp_name [142, 74] - [142, 83] + (variable [142, 74] - [142, 83])) + (exp_literal [142, 84] - [142, 86] + (string [142, 84] - [142, 86])))) + (signature [145, 0] - [145, 24] + name: (variable [145, 0] - [145, 2]) + type: (fun [145, 6] - [145, 24] + (type_name [145, 6] - [145, 15] + (type [145, 6] - [145, 15])) + (type_apply [145, 19] - [145, 24] + (type_name [145, 19] - [145, 21] + (type [145, 19] - [145, 21])) + (type_literal [145, 22] - [145, 24] + (con_unit [145, 22] - [145, 24]))))) + (function [146, 0] - [147, 62] + name: (variable [146, 0] - [146, 2]) + patterns: (patterns [146, 3] - [146, 33] + (pat_parens [146, 3] - [146, 33] + (pat_apply [146, 4] - [146, 32] + (pat_name [146, 4] - [146, 13] + (constructor [146, 4] - [146, 13])) + (pat_name [146, 14] - [146, 21] + (variable [146, 14] - [146, 21])) + (pat_name [146, 22] - [146, 26] + (variable [146, 22] - [146, 26])) + (pat_name [146, 27] - [146, 32] + (variable [146, 27] - [146, 32]))))) + rhs: (exp_apply [147, 4] - [147, 62] + (exp_name [147, 4] - [147, 12] + (variable [147, 4] - [147, 12])) + (exp_parens [147, 13] - [147, 62] + (exp_infix [147, 14] - [147, 60] + (exp_parens [147, 14] - [147, 34] + (exp_apply [147, 15] - [147, 33] + (exp_name [147, 15] - [147, 25] + (variable [147, 15] - [147, 25])) + (exp_name [147, 26] - [147, 30] + (variable [147, 26] - [147, 30])) + (exp_literal [147, 31] - [147, 33] + (string [147, 31] - [147, 33])))) + (operator [147, 35] - [147, 37]) + (exp_parens [147, 38] - [147, 60] + (exp_apply [147, 39] - [147, 59] + (exp_name [147, 39] - [147, 50] + (variable [147, 39] - [147, 50])) + (exp_name [147, 51] - [147, 56] + (variable [147, 51] - [147, 56])) + (exp_literal [147, 57] - [147, 59] + (string [147, 57] - [147, 59])))))))) + (signature [149, 0] - [149, 36] + name: (variable [149, 0] - [149, 13]) + type: (fun [149, 17] - [149, 36] + (type_name [149, 17] - [149, 26] + (type [149, 17] - [149, 26])) + (type_name [149, 30] - [149, 36] + (type [149, 30] - [149, 36])))) + (function [150, 0] - [150, 30] + name: (variable [150, 0] - [150, 13]) + patterns: (patterns [150, 14] - [150, 23] + (pat_name [150, 14] - [150, 23] + (variable [150, 14] - [150, 23]))) + rhs: (exp_literal [150, 27] - [150, 30] + (string [150, 27] - [150, 30]))) + (function [152, 0] - [152, 63] + name: (variable [152, 0] - [152, 5]) + patterns: (patterns [152, 6] - [152, 24] + (pat_name [152, 6] - [152, 10] + (variable [152, 6] - [152, 10])) + (pat_name [152, 11] - [152, 24] + (variable [152, 11] - [152, 24]))) + rhs: (exp_apply [152, 27] - [152, 63] + (exp_name [152, 27] - [152, 34] + (variable [152, 27] - [152, 34])) + (exp_parens [152, 35] - [152, 49] + (exp_apply [152, 36] - [152, 48] + (exp_name [152, 36] - [152, 40] + (constructor [152, 36] - [152, 40])) + (exp_name [152, 41] - [152, 45] + (variable [152, 41] - [152, 45])) + (exp_literal [152, 46] - [152, 48] + (string [152, 46] - [152, 48])))) + (exp_name [152, 50] - [152, 63] + (variable [152, 50] - [152, 63])))) + (signature [154, 0] - [154, 51] + name: (variable [154, 0] - [154, 11]) + type: (fun [154, 15] - [154, 51] + (type_name [154, 15] - [154, 21] + (type [154, 15] - [154, 21])) + (fun [154, 25] - [154, 51] + (type_list [154, 25] - [154, 36] + (type_name [154, 26] - [154, 35] + (type [154, 26] - [154, 35]))) + (type_list [154, 40] - [154, 51] + (type_name [154, 41] - [154, 50] + (type [154, 41] - [154, 50])))))) + (function [155, 0] - [158, 48] + name: (variable [155, 0] - [155, 11]) + patterns: (patterns [155, 12] - [155, 24] + (pat_name [155, 12] - [155, 19] + (variable [155, 12] - [155, 19])) + (pat_name [155, 20] - [155, 24] + (variable [155, 20] - [155, 24]))) + (guard_equation [156, 4] - [156, 19] + (guards [156, 4] - [156, 14] + (guard [156, 5] - [156, 14] + (exp_apply [156, 5] - [156, 14] + (exp_name [156, 5] - [156, 9] + (variable [156, 5] - [156, 9])) + (exp_name [156, 10] - [156, 14] + (variable [156, 10] - [156, 14]))))) + (exp_literal [156, 17] - [156, 19] + (con_list [156, 17] - [156, 19]))) + (guard_equation [157, 4] - [157, 51] + (guards [157, 4] - [157, 37] + (guard [157, 5] - [157, 37] + (exp_infix [157, 5] - [157, 37] + (exp_name [157, 5] - [157, 12] + (variable [157, 5] - [157, 12])) + (operator [157, 13] - [157, 15]) + (exp_parens [157, 16] - [157, 37] + (exp_apply [157, 17] - [157, 36] + (exp_name [157, 17] - [157, 24] + (variable [157, 17] - [157, 24])) + (exp_parens [157, 25] - [157, 36] + (exp_apply [157, 26] - [157, 35] + (exp_name [157, 26] - [157, 30] + (variable [157, 26] - [157, 30])) + (exp_name [157, 31] - [157, 35] + (variable [157, 31] - [157, 35]))))))))) + (exp_parens [157, 40] - [157, 51] + (exp_apply [157, 41] - [157, 50] + (exp_name [157, 41] - [157, 45] + (variable [157, 41] - [157, 45])) + (exp_name [157, 46] - [157, 50] + (variable [157, 46] - [157, 50]))))) + (guard_equation [158, 4] - [158, 48] + (guards [158, 4] - [158, 14] + (guard [158, 5] - [158, 14] + (exp_name [158, 5] - [158, 14] + (variable [158, 5] - [158, 14])))) + (exp_apply [158, 17] - [158, 48] + (exp_name [158, 17] - [158, 28] + (variable [158, 17] - [158, 28])) + (exp_name [158, 29] - [158, 36] + (variable [158, 29] - [158, 36])) + (exp_parens [158, 37] - [158, 48] + (exp_apply [158, 38] - [158, 47] + (exp_name [158, 38] - [158, 42] + (variable [158, 38] - [158, 42])) + (exp_name [158, 43] - [158, 47] + (variable [158, 43] - [158, 47]))))))) + (signature [160, 0] - [160, 41] + name: (variable [160, 0] - [160, 5]) + type: (fun [160, 9] - [160, 41] + (type_name [160, 9] - [160, 15] + (type [160, 9] - [160, 15])) + (fun [160, 19] - [160, 41] + (type_name [160, 19] - [160, 28] + (type [160, 19] - [160, 28])) + (type_name [160, 32] - [160, 41] + (type [160, 32] - [160, 41]))))) + (function [161, 0] - [162, 51] + name: (variable [161, 0] - [161, 5]) + patterns: (patterns [161, 6] - [161, 41] + (pat_name [161, 6] - [161, 13] + (variable [161, 6] - [161, 13])) + (pat_parens [161, 14] - [161, 41] + (pat_apply [161, 15] - [161, 40] + (pat_name [161, 15] - [161, 24] + (constructor [161, 15] - [161, 24])) + (pat_name [161, 25] - [161, 29] + (variable [161, 25] - [161, 29])) + (pat_name [161, 30] - [161, 34] + (variable [161, 30] - [161, 34])) + (pat_name [161, 35] - [161, 40] + (variable [161, 35] - [161, 40]))))) + rhs: (exp_apply [162, 4] - [162, 51] + (exp_name [162, 4] - [162, 13] + (constructor [162, 4] - [162, 13])) + (exp_name [162, 14] - [162, 18] + (variable [162, 14] - [162, 18])) + (exp_parens [162, 19] - [162, 45] + (exp_apply [162, 20] - [162, 44] + (exp_name [162, 20] - [162, 31] + (variable [162, 20] - [162, 31])) + (exp_name [162, 32] - [162, 39] + (variable [162, 32] - [162, 39])) + (exp_name [162, 40] - [162, 44] + (variable [162, 40] - [162, 44])))) + (exp_name [162, 46] - [162, 51] + (variable [162, 46] - [162, 51])))) + (signature [164, 0] - [164, 42] + name: (variable [164, 0] - [164, 12]) + type: (fun [164, 16] - [164, 42] + (type_name [164, 16] - [164, 22] + (type [164, 16] - [164, 22])) + (fun [164, 26] - [164, 42] + (type_list [164, 26] - [164, 32] + (type_name [164, 27] - [164, 31] + (type [164, 27] - [164, 31]))) + (type_list [164, 36] - [164, 42] + (type_name [164, 37] - [164, 41] + (type [164, 37] - [164, 41])))))) + (function [165, 0] - [168, 51] + name: (variable [165, 0] - [165, 12]) + patterns: (patterns [165, 13] - [165, 27] + (pat_name [165, 13] - [165, 21] + (variable [165, 13] - [165, 21])) + (pat_name [165, 22] - [165, 27] + (variable [165, 22] - [165, 27]))) + (guard_equation [166, 4] - [166, 20] + (guards [166, 4] - [166, 15] + (guard [166, 5] - [166, 15] + (exp_apply [166, 5] - [166, 15] + (exp_name [166, 5] - [166, 9] + (variable [166, 5] - [166, 9])) + (exp_name [166, 10] - [166, 15] + (variable [166, 10] - [166, 15]))))) + (exp_literal [166, 18] - [166, 20] + (con_list [166, 18] - [166, 20]))) + (guard_equation [167, 4] - [167, 55] + (guards [167, 4] - [167, 40] + (guard [167, 5] - [167, 40] + (exp_infix [167, 5] - [167, 40] + (exp_name [167, 5] - [167, 13] + (variable [167, 5] - [167, 13])) + (operator [167, 14] - [167, 16]) + (exp_parens [167, 17] - [167, 40] + (exp_apply [167, 18] - [167, 39] + (exp_name [167, 18] - [167, 26] + (variable [167, 18] - [167, 26])) + (exp_parens [167, 27] - [167, 39] + (exp_apply [167, 28] - [167, 38] + (exp_name [167, 28] - [167, 32] + (variable [167, 28] - [167, 32])) + (exp_name [167, 33] - [167, 38] + (variable [167, 33] - [167, 38]))))))))) + (exp_parens [167, 43] - [167, 55] + (exp_apply [167, 44] - [167, 54] + (exp_name [167, 44] - [167, 48] + (variable [167, 44] - [167, 48])) + (exp_name [167, 49] - [167, 54] + (variable [167, 49] - [167, 54]))))) + (guard_equation [168, 4] - [168, 51] + (guards [168, 4] - [168, 14] + (guard [168, 5] - [168, 14] + (exp_name [168, 5] - [168, 14] + (variable [168, 5] - [168, 14])))) + (exp_apply [168, 17] - [168, 51] + (exp_name [168, 17] - [168, 29] + (variable [168, 17] - [168, 29])) + (exp_name [168, 30] - [168, 38] + (variable [168, 30] - [168, 38])) + (exp_parens [168, 39] - [168, 51] + (exp_apply [168, 40] - [168, 50] + (exp_name [168, 40] - [168, 44] + (variable [168, 40] - [168, 44])) + (exp_name [168, 45] - [168, 50] + (variable [168, 45] - [168, 50]))))))) + (signature [170, 0] - [170, 38] + name: (variable [170, 0] - [170, 2]) + type: (fun [170, 6] - [170, 38] + (type_name [170, 6] - [170, 12] + (type [170, 6] - [170, 12])) + (fun [170, 16] - [170, 38] + (type_name [170, 16] - [170, 25] + (type [170, 16] - [170, 25])) + (type_name [170, 29] - [170, 38] + (type [170, 29] - [170, 38]))))) + (function [171, 0] - [172, 53] + name: (variable [171, 0] - [171, 2]) + patterns: (patterns [171, 3] - [171, 39] + (pat_name [171, 3] - [171, 11] + (variable [171, 3] - [171, 11])) + (pat_parens [171, 12] - [171, 39] + (pat_apply [171, 13] - [171, 38] + (pat_name [171, 13] - [171, 22] + (constructor [171, 13] - [171, 22])) + (pat_name [171, 23] - [171, 27] + (variable [171, 23] - [171, 27])) + (pat_name [171, 28] - [171, 32] + (variable [171, 28] - [171, 32])) + (pat_name [171, 33] - [171, 38] + (variable [171, 33] - [171, 38]))))) + rhs: (exp_apply [172, 4] - [172, 53] + (exp_name [172, 4] - [172, 13] + (constructor [172, 4] - [172, 13])) + (exp_name [172, 14] - [172, 18] + (variable [172, 14] - [172, 18])) + (exp_name [172, 19] - [172, 23] + (variable [172, 19] - [172, 23])) + (exp_parens [172, 24] - [172, 53] + (exp_apply [172, 25] - [172, 52] + (exp_name [172, 25] - [172, 37] + (variable [172, 25] - [172, 37])) + (exp_name [172, 38] - [172, 46] + (variable [172, 38] - [172, 46])) + (exp_name [172, 47] - [172, 52] + (variable [172, 47] - [172, 52])))))) + (signature [174, 0] - [174, 57] + name: (variable [174, 0] - [174, 6]) + type: (fun [174, 10] - [174, 57] + (type_name [174, 10] - [174, 19] + (type [174, 10] - [174, 19])) + (fun [174, 23] - [174, 57] + (type_apply [174, 23] - [174, 38] + (type_name [174, 23] - [174, 28] + (type [174, 23] - [174, 28])) + (type_name [174, 29] - [174, 38] + (type [174, 29] - [174, 38]))) + (type_apply [174, 42] - [174, 57] + (type_name [174, 42] - [174, 47] + (type [174, 42] - [174, 47])) + (type_name [174, 48] - [174, 57] + (type [174, 48] - [174, 57])))))) + (function [175, 0] - [175, 26] + name: (variable [175, 0] - [175, 6]) + patterns: (patterns [175, 7] - [175, 16] + (pat_wildcard [175, 7] - [175, 8]) + (pat_name [175, 9] - [175, 16] + (constructor [175, 9] - [175, 16]))) + rhs: (exp_name [175, 19] - [175, 26] + (constructor [175, 19] - [175, 26]))) + (function [176, 0] - [177, 58] + name: (variable [176, 0] - [176, 6]) + patterns: (patterns [176, 7] - [176, 56] + (pat_parens [176, 7] - [176, 36] + (pat_apply [176, 8] - [176, 35] + (pat_name [176, 8] - [176, 17] + (constructor [176, 8] - [176, 17])) + (pat_name [176, 18] - [176, 25] + (variable [176, 18] - [176, 25])) + (pat_name [176, 26] - [176, 30] + (variable [176, 26] - [176, 30])) + (pat_name [176, 31] - [176, 35] + (variable [176, 31] - [176, 35])))) + (pat_parens [176, 37] - [176, 56] + (pat_apply [176, 38] - [176, 55] + (pat_name [176, 38] - [176, 42] + (constructor [176, 38] - [176, 42])) + (pat_name [176, 43] - [176, 55] + (variable [176, 43] - [176, 55]))))) + rhs: (exp_apply [177, 4] - [177, 58] + (exp_name [177, 4] - [177, 8] + (constructor [177, 4] - [177, 8])) + (exp_parens [177, 9] - [177, 58] + (exp_apply [177, 10] - [177, 57] + (exp_name [177, 10] - [177, 19] + (constructor [177, 10] - [177, 19])) + (exp_name [177, 20] - [177, 27] + (variable [177, 20] - [177, 27])) + (exp_parens [177, 28] - [177, 52] + (exp_infix [177, 29] - [177, 51] + (exp_name [177, 29] - [177, 33] + (variable [177, 29] - [177, 33])) + (operator [177, 34] - [177, 36]) + (exp_list [177, 37] - [177, 51] + (exp_name [177, 38] - [177, 50] + (variable [177, 38] - [177, 50]))))) + (exp_name [177, 53] - [177, 57] + (variable [177, 53] - [177, 57])))))) + (signature [179, 0] - [179, 78] + name: (variable [179, 0] - [179, 15]) + type: (fun [179, 19] - [179, 78] + (type_apply [179, 19] - [179, 34] + (type_name [179, 19] - [179, 24] + (type [179, 19] - [179, 24])) + (type_name [179, 25] - [179, 34] + (type [179, 25] - [179, 34]))) + (fun [179, 38] - [179, 78] + (type_list [179, 38] - [179, 46] + (type_name [179, 39] - [179, 45] + (type [179, 39] - [179, 45]))) + (fun [179, 50] - [179, 78] + (type_name [179, 50] - [179, 59] + (type [179, 50] - [179, 59])) + (type_apply [179, 63] - [179, 78] + (type_name [179, 63] - [179, 68] + (type [179, 63] - [179, 68])) + (type_name [179, 69] - [179, 78] + (type [179, 69] - [179, 78]))))))) + (function [180, 0] - [180, 37] + name: (variable [180, 0] - [180, 15]) + patterns: (patterns [180, 16] - [180, 27] + (pat_name [180, 16] - [180, 23] + (constructor [180, 16] - [180, 23])) + (pat_wildcard [180, 24] - [180, 25]) + (pat_wildcard [180, 26] - [180, 27])) + rhs: (exp_name [180, 30] - [180, 37] + (constructor [180, 30] - [180, 37]))) + (function [181, 0] - [181, 63] + name: (variable [181, 0] - [181, 15]) + patterns: (patterns [181, 16] - [181, 37] + (pat_wildcard [181, 16] - [181, 17]) + (pat_literal [181, 18] - [181, 20] + (con_list [181, 18] - [181, 20])) + (pat_name [181, 21] - [181, 37] + (variable [181, 21] - [181, 37]))) + rhs: (exp_parens [181, 40] - [181, 63] + (exp_apply [181, 41] - [181, 62] + (exp_name [181, 41] - [181, 45] + (constructor [181, 41] - [181, 45])) + (exp_name [181, 46] - [181, 62] + (variable [181, 46] - [181, 62]))))) + (function [182, 0] - [187, 60] + name: (variable [182, 0] - [182, 15]) + patterns: (patterns [182, 16] - [182, 64] + (pat_parens [182, 16] - [182, 36] + (pat_apply [182, 17] - [182, 35] + (pat_name [182, 17] - [182, 21] + (constructor [182, 17] - [182, 21])) + (pat_name [182, 22] - [182, 35] + (variable [182, 22] - [182, 35])))) + (pat_name [182, 37] - [182, 47] + (variable [182, 37] - [182, 47])) + (pat_name [182, 48] - [182, 64] + (variable [182, 48] - [182, 64]))) + rhs: (exp_let_in [183, 4] - [187, 60] + (exp_let [183, 4] - [183, 113] + (decls [183, 8] - [183, 113] + (function [183, 8] - [183, 113] + name: (variable [183, 8] - [183, 9]) + rhs: (exp_apply [183, 12] - [183, 113] + (exp_name [183, 12] - [183, 27] + (variable [183, 12] - [183, 27])) + (exp_parens [183, 28] - [183, 78] + (exp_apply [183, 29] - [183, 77] + (exp_name [183, 29] - [183, 31] + (variable [183, 29] - [183, 31])) + (exp_parens [183, 32] - [183, 49] + (exp_apply [183, 33] - [183, 48] + (exp_name [183, 33] - [183, 37] + (variable [183, 33] - [183, 37])) + (exp_name [183, 38] - [183, 48] + (variable [183, 38] - [183, 48])))) + (exp_name [183, 50] - [183, 63] + (variable [183, 50] - [183, 63])) + (exp_name [183, 64] - [183, 77] + (variable [183, 64] - [183, 77])))) + (exp_parens [183, 79] - [183, 96] + (exp_apply [183, 80] - [183, 95] + (exp_name [183, 80] - [183, 84] + (variable [183, 80] - [183, 84])) + (exp_name [183, 85] - [183, 95] + (variable [183, 85] - [183, 95])))) + (exp_name [183, 97] - [183, 113] + (variable [183, 97] - [183, 113])))))) + (exp_in [183, 114] - [187, 60] + (exp_cond [184, 8] - [187, 60] + if: (exp_infix [184, 11] - [184, 44] + (exp_parens [184, 11] - [184, 37] + (exp_apply [184, 12] - [184, 36] + (exp_name [184, 12] - [184, 19] + (variable [184, 12] - [184, 19])) + (exp_name [184, 20] - [184, 36] + (variable [184, 20] - [184, 36])))) + (operator [184, 38] - [184, 40]) + (exp_literal [184, 41] - [184, 44] + (string [184, 41] - [184, 44]))) + then: (exp_apply [185, 12] - [185, 33] + (exp_name [185, 12] - [185, 16] + (constructor [185, 12] - [185, 16])) + (exp_name [185, 17] - [185, 33] + (variable [185, 17] - [185, 33]))) + else: (exp_apply [187, 12] - [187, 60] + (exp_name [187, 12] - [187, 18] + (variable [187, 12] - [187, 18])) + (exp_parens [187, 19] - [187, 58] + (exp_apply [187, 20] - [187, 57] + (exp_name [187, 20] - [187, 25] + (variable [187, 20] - [187, 25])) + (exp_parens [187, 26] - [187, 43] + (exp_apply [187, 27] - [187, 42] + (exp_name [187, 27] - [187, 31] + (variable [187, 27] - [187, 31])) + (exp_name [187, 32] - [187, 42] + (variable [187, 32] - [187, 42])))) + (exp_name [187, 44] - [187, 57] + (variable [187, 44] - [187, 57])))) + (exp_name [187, 59] - [187, 60] + (variable [187, 59] - [187, 60]))))))) + (comment [187, 61] - [187, 86]) + (signature [189, 0] - [189, 81] + name: (variable [189, 0] - [189, 12]) + type: (fun [189, 16] - [189, 81] + (type_list [189, 16] - [189, 24] + (type_name [189, 17] - [189, 23] + (type [189, 17] - [189, 23]))) + (fun [189, 28] - [189, 81] + (type_apply [189, 28] - [189, 43] + (type_name [189, 28] - [189, 33] + (type [189, 28] - [189, 33])) + (type_name [189, 34] - [189, 43] + (type [189, 34] - [189, 43]))) + (fun [189, 47] - [189, 81] + (type_name [189, 47] - [189, 53] + (type [189, 47] - [189, 53])) + (fun [189, 57] - [189, 81] + (type_apply [189, 57] - [189, 72] + (type_name [189, 57] - [189, 62] + (type [189, 57] - [189, 62])) + (type_name [189, 63] - [189, 72] + (type [189, 63] - [189, 72]))) + (type_apply [189, 76] - [189, 81] + (type_name [189, 76] - [189, 78] + (type [189, 76] - [189, 78])) + (type_literal [189, 79] - [189, 81] + (con_unit [189, 79] - [189, 81])))))))) + (function [190, 0] - [195, 68] + name: (variable [190, 0] - [190, 12]) + patterns: (patterns [190, 13] - [190, 66] + (pat_name [190, 13] - [190, 19] + (variable [190, 13] - [190, 19])) + (pat_parens [190, 20] - [190, 40] + (pat_apply [190, 21] - [190, 39] + (pat_name [190, 21] - [190, 25] + (constructor [190, 21] - [190, 25])) + (pat_name [190, 26] - [190, 39] + (variable [190, 26] - [190, 39])))) + (pat_name [190, 41] - [190, 45] + (variable [190, 41] - [190, 45])) + (pat_parens [190, 46] - [190, 66] + (pat_apply [190, 47] - [190, 65] + (pat_name [190, 47] - [190, 51] + (constructor [190, 47] - [190, 51])) + (pat_name [190, 52] - [190, 65] + (variable [190, 52] - [190, 65]))))) + rhs: (exp_do [190, 69] - [195, 68] + (stmt [191, 4] - [191, 66] + (let [191, 4] - [191, 66] + (decls [191, 8] - [191, 66] + (function [191, 8] - [191, 66] + name: (variable [191, 8] - [191, 24]) + rhs: (exp_parens [191, 27] - [191, 66] + (exp_apply [191, 28] - [191, 65] + (exp_name [191, 28] - [191, 30] + (variable [191, 28] - [191, 30])) + (exp_parens [191, 31] - [191, 51] + (exp_apply [191, 32] - [191, 50] + (exp_name [191, 32] - [191, 36] + (variable [191, 32] - [191, 36])) + (exp_parens [191, 37] - [191, 50] + (exp_apply [191, 38] - [191, 49] + (exp_name [191, 38] - [191, 42] + (variable [191, 38] - [191, 42])) + (exp_name [191, 43] - [191, 49] + (variable [191, 43] - [191, 49])))))) + (exp_name [191, 52] - [191, 65] + (variable [191, 52] - [191, 65])))))))) + (stmt [192, 4] - [192, 42] + (let [192, 4] - [192, 42] + (decls [192, 8] - [192, 42] + (function [192, 8] - [192, 42] + name: (variable [192, 8] - [192, 16]) + rhs: (exp_parens [192, 19] - [192, 42] + (exp_apply [192, 20] - [192, 41] + (exp_name [192, 20] - [192, 24] + (variable [192, 20] - [192, 24])) + (exp_parens [192, 25] - [192, 41] + (exp_apply [192, 26] - [192, 40] + (exp_name [192, 26] - [192, 35] + (variable [192, 26] - [192, 35])) + (exp_name [192, 36] - [192, 40] + (variable [192, 36] - [192, 40])))))))))) + (stmt [193, 4] - [193, 96] + (let [193, 4] - [193, 96] + (decls [193, 8] - [193, 96] + (function [193, 8] - [193, 96] + pattern: (pat_parens [193, 8] - [193, 31] + (pat_apply [193, 9] - [193, 30] + (pat_name [193, 9] - [193, 13] + (constructor [193, 9] - [193, 13])) + (pat_name [193, 14] - [193, 30] + (variable [193, 14] - [193, 30])))) + rhs: (exp_apply [193, 34] - [193, 96] + (exp_name [193, 34] - [193, 49] + (variable [193, 34] - [193, 49])) + (exp_parens [193, 50] - [193, 70] + (exp_apply [193, 51] - [193, 69] + (exp_name [193, 51] - [193, 55] + (constructor [193, 51] - [193, 55])) + (exp_name [193, 56] - [193, 69] + (variable [193, 56] - [193, 69])))) + (exp_name [193, 71] - [193, 79] + (variable [193, 71] - [193, 79])) + (exp_name [193, 80] - [193, 96] + (variable [193, 80] - [193, 96]))))))) + (stmt [194, 4] - [194, 68] + (let [194, 4] - [194, 68] + (decls [194, 8] - [194, 68] + (function [194, 8] - [194, 67] + name: (variable [194, 8] - [194, 24]) + rhs: (exp_parens [194, 27] - [194, 67] + (exp_apply [194, 28] - [194, 66] + (exp_name [194, 28] - [194, 30] + (variable [194, 28] - [194, 30])) + (exp_name [194, 31] - [194, 35] + (variable [194, 31] - [194, 35])) + (exp_name [194, 36] - [194, 52] + (variable [194, 36] - [194, 52])) + (exp_name [194, 53] - [194, 66] + (variable [194, 53] - [194, 66])))))))) + (stmt [195, 4] - [195, 68] + (exp_apply [195, 4] - [195, 68] + (exp_name [195, 4] - [195, 22] + (variable [195, 4] - [195, 22])) + (exp_parens [195, 23] - [195, 46] + (exp_apply [195, 24] - [195, 45] + (exp_name [195, 24] - [195, 28] + (constructor [195, 24] - [195, 28])) + (exp_name [195, 29] - [195, 45] + (variable [195, 29] - [195, 45])))) + (exp_name [195, 47] - [195, 51] + (variable [195, 47] - [195, 51])) + (exp_name [195, 52] - [195, 68] + (variable [195, 52] - [195, 68])))))) + (signature [197, 0] - [197, 84] + name: (variable [197, 0] - [197, 15]) + type: (fun [197, 19] - [197, 84] + (type_list [197, 19] - [197, 27] + (type_name [197, 20] - [197, 26] + (type [197, 20] - [197, 26]))) + (fun [197, 31] - [197, 84] + (type_apply [197, 31] - [197, 46] + (type_name [197, 31] - [197, 36] + (type [197, 31] - [197, 36])) + (type_name [197, 37] - [197, 46] + (type [197, 37] - [197, 46]))) + (fun [197, 50] - [197, 84] + (type_name [197, 50] - [197, 56] + (type [197, 50] - [197, 56])) + (fun [197, 60] - [197, 84] + (type_apply [197, 60] - [197, 75] + (type_name [197, 60] - [197, 65] + (type [197, 60] - [197, 65])) + (type_name [197, 66] - [197, 75] + (type [197, 66] - [197, 75]))) + (type_apply [197, 79] - [197, 84] + (type_name [197, 79] - [197, 81] + (type [197, 79] - [197, 81])) + (type_literal [197, 82] - [197, 84] + (con_unit [197, 82] - [197, 84])))))))) + (function [198, 0] - [203, 68] + name: (variable [198, 0] - [198, 15]) + patterns: (patterns [198, 16] - [198, 69] + (pat_name [198, 16] - [198, 22] + (variable [198, 16] - [198, 22])) + (pat_parens [198, 23] - [198, 43] + (pat_apply [198, 24] - [198, 42] + (pat_name [198, 24] - [198, 28] + (constructor [198, 24] - [198, 28])) + (pat_name [198, 29] - [198, 42] + (variable [198, 29] - [198, 42])))) + (pat_name [198, 44] - [198, 48] + (variable [198, 44] - [198, 48])) + (pat_parens [198, 49] - [198, 69] + (pat_apply [198, 50] - [198, 68] + (pat_name [198, 50] - [198, 54] + (constructor [198, 50] - [198, 54])) + (pat_name [198, 55] - [198, 68] + (variable [198, 55] - [198, 68]))))) + rhs: (exp_do [198, 72] - [203, 68] + (stmt [199, 4] - [199, 69] + (let [199, 4] - [199, 69] + (decls [199, 8] - [199, 69] + (function [199, 8] - [199, 69] + name: (variable [199, 8] - [199, 24]) + rhs: (exp_parens [199, 27] - [199, 69] + (exp_apply [199, 28] - [199, 68] + (exp_name [199, 28] - [199, 33] + (variable [199, 28] - [199, 33])) + (exp_parens [199, 34] - [199, 54] + (exp_apply [199, 35] - [199, 53] + (exp_name [199, 35] - [199, 39] + (variable [199, 35] - [199, 39])) + (exp_parens [199, 40] - [199, 53] + (exp_apply [199, 41] - [199, 52] + (exp_name [199, 41] - [199, 45] + (variable [199, 41] - [199, 45])) + (exp_name [199, 46] - [199, 52] + (variable [199, 46] - [199, 52])))))) + (exp_name [199, 55] - [199, 68] + (variable [199, 55] - [199, 68])))))))) + (stmt [200, 4] - [200, 42] + (let [200, 4] - [200, 42] + (decls [200, 8] - [200, 42] + (function [200, 8] - [200, 42] + name: (variable [200, 8] - [200, 16]) + rhs: (exp_parens [200, 19] - [200, 42] + (exp_apply [200, 20] - [200, 41] + (exp_name [200, 20] - [200, 24] + (variable [200, 20] - [200, 24])) + (exp_parens [200, 25] - [200, 41] + (exp_apply [200, 26] - [200, 40] + (exp_name [200, 26] - [200, 35] + (variable [200, 26] - [200, 35])) + (exp_name [200, 36] - [200, 40] + (variable [200, 36] - [200, 40])))))))))) + (stmt [201, 4] - [201, 96] + (let [201, 4] - [201, 96] + (decls [201, 8] - [201, 96] + (function [201, 8] - [201, 96] + pattern: (pat_parens [201, 8] - [201, 31] + (pat_apply [201, 9] - [201, 30] + (pat_name [201, 9] - [201, 13] + (constructor [201, 9] - [201, 13])) + (pat_name [201, 14] - [201, 30] + (variable [201, 14] - [201, 30])))) + rhs: (exp_apply [201, 34] - [201, 96] + (exp_name [201, 34] - [201, 49] + (variable [201, 34] - [201, 49])) + (exp_parens [201, 50] - [201, 70] + (exp_apply [201, 51] - [201, 69] + (exp_name [201, 51] - [201, 55] + (constructor [201, 51] - [201, 55])) + (exp_name [201, 56] - [201, 69] + (variable [201, 56] - [201, 69])))) + (exp_name [201, 71] - [201, 79] + (variable [201, 71] - [201, 79])) + (exp_name [201, 80] - [201, 96] + (variable [201, 80] - [201, 96]))))))) + (stmt [202, 4] - [202, 68] + (let [202, 4] - [202, 68] + (decls [202, 8] - [202, 68] + (function [202, 8] - [202, 67] + name: (variable [202, 8] - [202, 24]) + rhs: (exp_parens [202, 27] - [202, 67] + (exp_apply [202, 28] - [202, 66] + (exp_name [202, 28] - [202, 30] + (variable [202, 28] - [202, 30])) + (exp_name [202, 31] - [202, 35] + (variable [202, 31] - [202, 35])) + (exp_name [202, 36] - [202, 52] + (variable [202, 36] - [202, 52])) + (exp_name [202, 53] - [202, 66] + (variable [202, 53] - [202, 66])))))))) + (stmt [203, 4] - [203, 68] + (exp_apply [203, 4] - [203, 68] + (exp_name [203, 4] - [203, 22] + (variable [203, 4] - [203, 22])) + (exp_parens [203, 23] - [203, 46] + (exp_apply [203, 24] - [203, 45] + (exp_name [203, 24] - [203, 28] + (constructor [203, 24] - [203, 28])) + (exp_name [203, 29] - [203, 45] + (variable [203, 29] - [203, 45])))) + (exp_name [203, 47] - [203, 51] + (variable [203, 47] - [203, 51])) + (exp_name [203, 52] - [203, 68] + (variable [203, 52] - [203, 68])))))) + (signature [205, 0] - [205, 84] + name: (variable [205, 0] - [205, 15]) + type: (fun [205, 19] - [205, 84] + (type_list [205, 19] - [205, 27] + (type_name [205, 20] - [205, 26] + (type [205, 20] - [205, 26]))) + (fun [205, 31] - [205, 84] + (type_apply [205, 31] - [205, 46] + (type_name [205, 31] - [205, 36] + (type [205, 31] - [205, 36])) + (type_name [205, 37] - [205, 46] + (type [205, 37] - [205, 46]))) + (fun [205, 50] - [205, 84] + (type_name [205, 50] - [205, 56] + (type [205, 50] - [205, 56])) + (fun [205, 60] - [205, 84] + (type_apply [205, 60] - [205, 75] + (type_name [205, 60] - [205, 65] + (type [205, 60] - [205, 65])) + (type_name [205, 66] - [205, 75] + (type [205, 66] - [205, 75]))) + (type_apply [205, 79] - [205, 84] + (type_name [205, 79] - [205, 81] + (type [205, 79] - [205, 81])) + (type_literal [205, 82] - [205, 84] + (con_unit [205, 82] - [205, 84])))))))) + (function [206, 0] - [211, 65] + name: (variable [206, 0] - [206, 15]) + patterns: (patterns [206, 16] - [206, 69] + (pat_name [206, 16] - [206, 22] + (variable [206, 16] - [206, 22])) + (pat_parens [206, 23] - [206, 43] + (pat_apply [206, 24] - [206, 42] + (pat_name [206, 24] - [206, 28] + (constructor [206, 24] - [206, 28])) + (pat_name [206, 29] - [206, 42] + (variable [206, 29] - [206, 42])))) + (pat_name [206, 44] - [206, 48] + (variable [206, 44] - [206, 48])) + (pat_parens [206, 49] - [206, 69] + (pat_apply [206, 50] - [206, 68] + (pat_name [206, 50] - [206, 54] + (constructor [206, 50] - [206, 54])) + (pat_name [206, 55] - [206, 68] + (variable [206, 55] - [206, 68]))))) + rhs: (exp_do [206, 72] - [211, 65] + (stmt [207, 4] - [207, 69] + (let [207, 4] - [207, 69] + (decls [207, 8] - [207, 69] + (function [207, 8] - [207, 69] + name: (variable [207, 8] - [207, 24]) + rhs: (exp_parens [207, 27] - [207, 69] + (exp_apply [207, 28] - [207, 68] + (exp_name [207, 28] - [207, 33] + (variable [207, 28] - [207, 33])) + (exp_parens [207, 34] - [207, 54] + (exp_apply [207, 35] - [207, 53] + (exp_name [207, 35] - [207, 39] + (variable [207, 35] - [207, 39])) + (exp_parens [207, 40] - [207, 53] + (exp_apply [207, 41] - [207, 52] + (exp_name [207, 41] - [207, 45] + (variable [207, 41] - [207, 45])) + (exp_name [207, 46] - [207, 52] + (variable [207, 46] - [207, 52])))))) + (exp_name [207, 55] - [207, 68] + (variable [207, 55] - [207, 68])))))))) + (stmt [208, 4] - [208, 42] + (let [208, 4] - [208, 42] + (decls [208, 8] - [208, 42] + (function [208, 8] - [208, 42] + name: (variable [208, 8] - [208, 16]) + rhs: (exp_parens [208, 19] - [208, 42] + (exp_apply [208, 20] - [208, 41] + (exp_name [208, 20] - [208, 24] + (variable [208, 20] - [208, 24])) + (exp_parens [208, 25] - [208, 41] + (exp_apply [208, 26] - [208, 40] + (exp_name [208, 26] - [208, 35] + (variable [208, 26] - [208, 35])) + (exp_name [208, 36] - [208, 40] + (variable [208, 36] - [208, 40])))))))))) + (stmt [209, 4] - [209, 96] + (let [209, 4] - [209, 96] + (decls [209, 8] - [209, 96] + (function [209, 8] - [209, 96] + pattern: (pat_parens [209, 8] - [209, 31] + (pat_apply [209, 9] - [209, 30] + (pat_name [209, 9] - [209, 13] + (constructor [209, 9] - [209, 13])) + (pat_name [209, 14] - [209, 30] + (variable [209, 14] - [209, 30])))) + rhs: (exp_apply [209, 34] - [209, 96] + (exp_name [209, 34] - [209, 49] + (variable [209, 34] - [209, 49])) + (exp_parens [209, 50] - [209, 70] + (exp_apply [209, 51] - [209, 69] + (exp_name [209, 51] - [209, 55] + (constructor [209, 51] - [209, 55])) + (exp_name [209, 56] - [209, 69] + (variable [209, 56] - [209, 69])))) + (exp_name [209, 71] - [209, 79] + (variable [209, 71] - [209, 79])) + (exp_name [209, 80] - [209, 96] + (variable [209, 80] - [209, 96]))))))) + (stmt [210, 4] - [210, 68] + (let [210, 4] - [210, 68] + (decls [210, 8] - [210, 68] + (function [210, 8] - [210, 67] + name: (variable [210, 8] - [210, 24]) + rhs: (exp_parens [210, 27] - [210, 67] + (exp_apply [210, 28] - [210, 66] + (exp_name [210, 28] - [210, 30] + (variable [210, 28] - [210, 30])) + (exp_name [210, 31] - [210, 35] + (variable [210, 31] - [210, 35])) + (exp_name [210, 36] - [210, 52] + (variable [210, 36] - [210, 52])) + (exp_name [210, 53] - [210, 66] + (variable [210, 53] - [210, 66])))))))) + (stmt [211, 4] - [211, 65] + (exp_apply [211, 4] - [211, 65] + (exp_name [211, 4] - [211, 22] + (variable [211, 4] - [211, 22])) + (exp_parens [211, 23] - [211, 43] + (exp_apply [211, 24] - [211, 42] + (exp_name [211, 24] - [211, 28] + (constructor [211, 24] - [211, 28])) + (exp_name [211, 29] - [211, 42] + (variable [211, 29] - [211, 42])))) + (exp_name [211, 44] - [211, 48] + (variable [211, 44] - [211, 48])) + (exp_name [211, 49] - [211, 65] + (variable [211, 49] - [211, 65])))))) + (signature [213, 0] - [213, 39] + name: (variable [213, 0] - [213, 9]) + type: (fun [213, 13] - [213, 39] + (type_name [213, 13] - [213, 19] + (type [213, 13] - [213, 19])) + (fun [213, 23] - [213, 39] + (type_name [213, 23] - [213, 29] + (type [213, 23] - [213, 29])) + (type_name [213, 33] - [213, 39] + (type [213, 33] - [213, 39]))))) + (function [214, 0] - [217, 29] + name: (variable [214, 0] - [214, 9]) + patterns: (patterns [214, 10] - [214, 19] + (pat_name [214, 10] - [214, 14] + (variable [214, 10] - [214, 14])) + (pat_name [214, 15] - [214, 19] + (variable [214, 15] - [214, 19]))) + rhs: (exp_cond [214, 22] - [217, 29] + if: (exp_infix [214, 25] - [214, 36] + (exp_name [214, 25] - [214, 29] + (variable [214, 25] - [214, 29])) + (operator [214, 30] - [214, 32]) + (exp_literal [214, 33] - [214, 36] + (string [214, 33] - [214, 36]))) + then: (exp_parens [215, 8] - [215, 22] + (exp_infix [215, 9] - [215, 21] + (exp_name [215, 9] - [215, 13] + (variable [215, 9] - [215, 13])) + (operator [215, 14] - [215, 16]) + (exp_name [215, 17] - [215, 21] + (variable [215, 17] - [215, 21])))) + else: (exp_parens [217, 8] - [217, 29] + (exp_infix [217, 9] - [217, 28] + (exp_infix [217, 9] - [217, 20] + (exp_name [217, 9] - [217, 13] + (variable [217, 9] - [217, 13])) + (operator [217, 14] - [217, 16]) + (exp_literal [217, 17] - [217, 20] + (string [217, 17] - [217, 20]))) + (operator [217, 21] - [217, 23]) + (exp_name [217, 24] - [217, 28] + (variable [217, 24] - [217, 28])))))) + (signature [219, 0] - [219, 75] + name: (variable [219, 0] - [219, 18]) + type: (fun [219, 22] - [219, 75] + (type_apply [219, 22] - [219, 37] + (type_name [219, 22] - [219, 27] + (type [219, 22] - [219, 27])) + (type_name [219, 28] - [219, 37] + (type [219, 28] - [219, 37]))) + (fun [219, 41] - [219, 75] + (type_name [219, 41] - [219, 47] + (type [219, 41] - [219, 47])) + (fun [219, 51] - [219, 75] + (type_apply [219, 51] - [219, 66] + (type_name [219, 51] - [219, 56] + (type [219, 51] - [219, 56])) + (type_name [219, 57] - [219, 66] + (type [219, 57] - [219, 66]))) + (type_apply [219, 70] - [219, 75] + (type_name [219, 70] - [219, 72] + (type [219, 70] - [219, 72])) + (type_literal [219, 73] - [219, 75] + (con_unit [219, 73] - [219, 75]))))))) + (function [220, 0] - [236, 69] + name: (variable [220, 0] - [220, 18]) + patterns: (patterns [220, 19] - [220, 65] + (pat_parens [220, 19] - [220, 39] + (pat_apply [220, 20] - [220, 38] + (pat_name [220, 20] - [220, 24] + (constructor [220, 20] - [220, 24])) + (pat_name [220, 25] - [220, 38] + (variable [220, 25] - [220, 38])))) + (pat_name [220, 40] - [220, 44] + (variable [220, 40] - [220, 44])) + (pat_parens [220, 45] - [220, 65] + (pat_apply [220, 46] - [220, 64] + (pat_name [220, 46] - [220, 50] + (constructor [220, 46] - [220, 50])) + (pat_name [220, 51] - [220, 64] + (variable [220, 51] - [220, 64]))))) + rhs: (exp_do [220, 68] - [236, 69] + (stmt [221, 4] - [221, 20] + (bind_pattern [221, 4] - [221, 20] + (pat_name [221, 4] - [221, 9] + (variable [221, 4] - [221, 9])) + (exp_name [221, 13] - [221, 20] + (variable [221, 13] - [221, 20])))) + (stmt [222, 4] - [222, 33] + (let [222, 4] - [222, 33] + (decls [222, 8] - [222, 33] + (function [222, 8] - [222, 33] + name: (variable [222, 8] - [222, 14]) + rhs: (exp_apply [222, 17] - [222, 33] + (exp_name [222, 17] - [222, 27] + (variable [222, 17] - [222, 27])) + (exp_name [222, 28] - [222, 33] + (variable [222, 28] - [222, 33]))))))) + (stmt [223, 4] - [235, 42] + (exp_case [223, 4] - [235, 42] + (exp_apply [223, 9] - [223, 20] + (exp_name [223, 9] - [223, 13] + (variable [223, 9] - [223, 13])) + (exp_name [223, 14] - [223, 20] + (variable [223, 14] - [223, 20]))) + (alts [224, 8] - [235, 42] + (alt [224, 8] - [224, 70] + (pat_literal [224, 8] - [224, 13] + (string [224, 8] - [224, 13])) + (exp_apply [224, 17] - [224, 70] + (exp_name [224, 17] - [224, 20] + (variable [224, 17] - [224, 20])) + (exp_parens [224, 21] - [224, 34] + (exp_apply [224, 22] - [224, 33] + (exp_name [224, 22] - [224, 26] + (variable [224, 22] - [224, 26])) + (exp_name [224, 27] - [224, 33] + (variable [224, 27] - [224, 33])))) + (exp_name [224, 35] - [224, 39] + (variable [224, 35] - [224, 39])) + (exp_name [224, 40] - [224, 53] + (variable [224, 40] - [224, 53])) + (exp_name [224, 54] - [224, 67] + (variable [224, 54] - [224, 67])) + (exp_literal [224, 68] - [224, 70] + (string [224, 68] - [224, 70])))) + (alt [225, 8] - [225, 30] + (pat_literal [225, 8] - [225, 13] + (string [225, 8] - [225, 13])) + (exp_apply [225, 17] - [225, 30] + (exp_name [225, 17] - [225, 25] + (variable [225, 17] - [225, 25])) + (exp_name [225, 26] - [225, 30] + (variable [225, 26] - [225, 30])))) + (alt [226, 8] - [226, 82] + (pat_literal [226, 8] - [226, 12] + (string [226, 8] - [226, 12])) + (exp_apply [226, 16] - [226, 82] + (exp_name [226, 16] - [226, 28] + (variable [226, 16] - [226, 28])) + (exp_name [226, 29] - [226, 35] + (variable [226, 29] - [226, 35])) + (exp_parens [226, 36] - [226, 56] + (exp_apply [226, 37] - [226, 55] + (exp_name [226, 37] - [226, 41] + (constructor [226, 37] - [226, 41])) + (exp_name [226, 42] - [226, 55] + (variable [226, 42] - [226, 55])))) + (exp_name [226, 57] - [226, 61] + (variable [226, 57] - [226, 61])) + (exp_parens [226, 62] - [226, 82] + (exp_apply [226, 63] - [226, 81] + (exp_name [226, 63] - [226, 67] + (constructor [226, 63] - [226, 67])) + (exp_name [226, 68] - [226, 81] + (variable [226, 68] - [226, 81])))))) + (alt [227, 8] - [227, 88] + (pat_literal [227, 8] - [227, 15] + (string [227, 8] - [227, 15])) + (exp_apply [227, 19] - [227, 88] + (exp_name [227, 19] - [227, 34] + (variable [227, 19] - [227, 34])) + (exp_name [227, 35] - [227, 41] + (variable [227, 35] - [227, 41])) + (exp_parens [227, 42] - [227, 62] + (exp_apply [227, 43] - [227, 61] + (exp_name [227, 43] - [227, 47] + (constructor [227, 43] - [227, 47])) + (exp_name [227, 48] - [227, 61] + (variable [227, 48] - [227, 61])))) + (exp_name [227, 63] - [227, 67] + (variable [227, 63] - [227, 67])) + (exp_parens [227, 68] - [227, 88] + (exp_apply [227, 69] - [227, 87] + (exp_name [227, 69] - [227, 73] + (constructor [227, 69] - [227, 73])) + (exp_name [227, 74] - [227, 87] + (variable [227, 74] - [227, 87])))))) + (alt [228, 8] - [228, 88] + (pat_literal [228, 8] - [228, 15] + (string [228, 8] - [228, 15])) + (exp_apply [228, 19] - [228, 88] + (exp_name [228, 19] - [228, 34] + (variable [228, 19] - [228, 34])) + (exp_name [228, 35] - [228, 41] + (variable [228, 35] - [228, 41])) + (exp_parens [228, 42] - [228, 62] + (exp_apply [228, 43] - [228, 61] + (exp_name [228, 43] - [228, 47] + (constructor [228, 43] - [228, 47])) + (exp_name [228, 48] - [228, 61] + (variable [228, 48] - [228, 61])))) + (exp_name [228, 63] - [228, 67] + (variable [228, 63] - [228, 67])) + (exp_parens [228, 68] - [228, 88] + (exp_apply [228, 69] - [228, 87] + (exp_name [228, 69] - [228, 73] + (constructor [228, 69] - [228, 73])) + (exp_name [228, 74] - [228, 87] + (variable [228, 74] - [228, 87])))))) + (alt [229, 8] - [229, 32] + (pat_literal [229, 8] - [229, 12] + (string [229, 8] - [229, 12])) + (exp_apply [229, 16] - [229, 32] + (exp_name [229, 16] - [229, 18] + (variable [229, 16] - [229, 18])) + (exp_name [229, 19] - [229, 32] + (variable [229, 19] - [229, 32])))) + (comment [229, 32] - [229, 40]) + (alt [230, 8] - [234, 124] + (pat_literal [230, 8] - [230, 12] + (string [230, 8] - [230, 12])) + (exp_cond [230, 16] - [234, 124] + if: (exp_infix [230, 19] - [230, 83] + (exp_parens [230, 19] - [230, 72] + (exp_apply [230, 20] - [230, 71] + (exp_name [230, 20] - [230, 22] + (variable [230, 20] - [230, 22])) + (exp_parens [230, 23] - [230, 43] + (exp_apply [230, 24] - [230, 42] + (exp_name [230, 24] - [230, 28] + (variable [230, 24] - [230, 28])) + (exp_parens [230, 29] - [230, 42] + (exp_apply [230, 30] - [230, 41] + (exp_name [230, 30] - [230, 34] + (variable [230, 30] - [230, 34])) + (exp_name [230, 35] - [230, 41] + (variable [230, 35] - [230, 41])))))) + (exp_name [230, 44] - [230, 57] + (variable [230, 44] - [230, 57])) + (exp_name [230, 58] - [230, 71] + (variable [230, 58] - [230, 71])))) + (operator [230, 73] - [230, 75]) + (exp_name [230, 76] - [230, 83] + (constructor [230, 76] - [230, 83]))) + then: (exp_parens [231, 20] - [231, 61] + (exp_apply [231, 21] - [231, 60] + (exp_name [231, 21] - [231, 29] + (variable [231, 21] - [231, 29])) + (exp_literal [231, 30] - [231, 60] + (string [231, 30] - [231, 60])))) + else: (exp_let_in [233, 20] - [234, 124] + (exp_let [233, 20] - [233, 71] + (decls [233, 24] - [233, 71] + (function [233, 24] - [233, 71] + name: (variable [233, 24] - [233, 31]) + rhs: (exp_parens [233, 34] - [233, 71] + (exp_apply [233, 35] - [233, 70] + (exp_name [233, 35] - [233, 44] + (variable [233, 35] - [233, 44])) + (exp_name [233, 45] - [233, 49] + (variable [233, 45] - [233, 49])) + (exp_parens [233, 50] - [233, 70] + (exp_apply [233, 51] - [233, 69] + (exp_name [233, 51] - [233, 55] + (variable [233, 51] - [233, 55])) + (exp_parens [233, 56] - [233, 69] + (exp_apply [233, 57] - [233, 68] + (exp_name [233, 57] - [233, 61] + (variable [233, 57] - [233, 61])) + (exp_name [233, 62] - [233, 68] + (variable [233, 62] - [233, 68]))))))))))) + (exp_in [233, 72] - [234, 124] + (exp_parens [234, 21] - [234, 124] + (exp_apply [234, 22] - [234, 123] + (exp_name [234, 22] - [234, 40] + (variable [234, 22] - [234, 40])) + (exp_parens [234, 41] - [234, 61] + (exp_apply [234, 42] - [234, 60] + (exp_name [234, 42] - [234, 46] + (constructor [234, 42] - [234, 46])) + (exp_name [234, 47] - [234, 60] + (variable [234, 47] - [234, 60])))) + (exp_name [234, 62] - [234, 69] + (variable [234, 62] - [234, 69])) + (exp_parens [234, 70] - [234, 123] + (exp_apply [234, 71] - [234, 122] + (exp_name [234, 71] - [234, 73] + (variable [234, 71] - [234, 73])) + (exp_parens [234, 74] - [234, 94] + (exp_apply [234, 75] - [234, 93] + (exp_name [234, 75] - [234, 79] + (variable [234, 75] - [234, 79])) + (exp_parens [234, 80] - [234, 93] + (exp_apply [234, 81] - [234, 92] + (exp_name [234, 81] - [234, 85] + (variable [234, 81] - [234, 85])) + (exp_name [234, 86] - [234, 92] + (variable [234, 86] - [234, 92])))))) + (exp_name [234, 95] - [234, 108] + (variable [234, 95] - [234, 108])) + (exp_name [234, 109] - [234, 122] + (variable [234, 109] - [234, 122])))))))))) + (alt [235, 8] - [235, 42] + (pat_wildcard [235, 8] - [235, 9]) + (exp_apply [235, 13] - [235, 42] + (exp_name [235, 13] - [235, 21] + (variable [235, 13] - [235, 21])) + (exp_literal [235, 22] - [235, 42] + (string [235, 22] - [235, 42]))))))) + (stmt [236, 4] - [236, 69] + (exp_apply [236, 4] - [236, 69] + (exp_name [236, 4] - [236, 22] + (variable [236, 4] - [236, 22])) + (exp_parens [236, 23] - [236, 43] + (exp_apply [236, 24] - [236, 42] + (exp_name [236, 24] - [236, 28] + (constructor [236, 24] - [236, 28])) + (exp_name [236, 29] - [236, 42] + (variable [236, 29] - [236, 42])))) + (exp_name [236, 44] - [236, 48] + (variable [236, 44] - [236, 48])) + (exp_parens [236, 49] - [236, 69] + (exp_apply [236, 50] - [236, 68] + (exp_name [236, 50] - [236, 54] + (constructor [236, 50] - [236, 54])) + (exp_name [236, 55] - [236, 68] + (variable [236, 55] - [236, 68])))))))) + (signature [238, 0] - [238, 13] + name: (variable [238, 0] - [238, 4]) + type: (type_apply [238, 8] - [238, 13] + (type_name [238, 8] - [238, 10] + (type [238, 8] - [238, 10])) + (type_literal [238, 11] - [238, 13] + (con_unit [238, 11] - [238, 13])))) + (function [239, 0] - [244, 13] + name: (variable [239, 0] - [239, 4]) + rhs: (exp_do [239, 7] - [244, 13] + (stmt [240, 4] - [240, 43] + (let [240, 4] - [240, 43] + (decls [240, 8] - [240, 43] + (function [240, 8] - [240, 43] + name: (variable [240, 8] - [240, 21]) + rhs: (exp_apply [240, 24] - [240, 43] + (exp_name [240, 24] - [240, 33] + (constructor [240, 24] - [240, 33])) + (exp_literal [240, 34] - [240, 37] + (string [240, 34] - [240, 37])) + (exp_literal [240, 38] - [240, 40] + (con_list [240, 38] - [240, 40])) + (exp_literal [240, 41] - [240, 43] + (con_list [240, 41] - [240, 43]))))))) + (stmt [241, 4] - [241, 68] + (exp_apply [241, 4] - [241, 68] + (exp_name [241, 4] - [241, 22] + (variable [241, 4] - [241, 22])) + (exp_parens [241, 23] - [241, 43] + (exp_apply [241, 24] - [241, 42] + (exp_name [241, 24] - [241, 28] + (constructor [241, 24] - [241, 28])) + (exp_name [241, 29] - [241, 42] + (variable [241, 29] - [241, 42])))) + (exp_literal [241, 44] - [241, 47] + (string [241, 44] - [241, 47])) + (exp_parens [241, 48] - [241, 68] + (exp_apply [241, 49] - [241, 67] + (exp_name [241, 49] - [241, 53] + (constructor [241, 49] - [241, 53])) + (exp_name [241, 54] - [241, 67] + (variable [241, 54] - [241, 67])))))) + (stmt [242, 4] - [242, 33] + (exp_apply [242, 4] - [242, 33] + (exp_name [242, 4] - [242, 12] + (variable [242, 4] - [242, 12])) + (exp_parens [242, 13] - [242, 33] + (exp_apply [242, 14] - [242, 32] + (exp_name [242, 14] - [242, 18] + (variable [242, 14] - [242, 18])) + (exp_name [242, 19] - [242, 32] + (variable [242, 19] - [242, 32])))))) + (stmt [243, 4] - [243, 20] + (exp_apply [243, 4] - [243, 20] + (exp_name [243, 4] - [243, 12] + (variable [243, 4] - [243, 12])) + (exp_literal [243, 13] - [243, 20] + (string [243, 13] - [243, 20])))) + (stmt [244, 4] - [244, 13] + (exp_apply [244, 4] - [244, 13] + (exp_name [244, 4] - [244, 10] + (variable [244, 4] - [244, 10])) + (exp_literal [244, 11] - [244, 13] + (con_unit [244, 11] - [244, 13]))))))) diff --git a/homework/81906/hs2html/.gitignore b/homework/81906/hs2html/.gitignore new file mode 100644 index 00000000..f3a98847 --- /dev/null +++ b/homework/81906/hs2html/.gitignore @@ -0,0 +1,3 @@ +build +*.sln +*.vcxproj* diff --git a/homework/81906/hs2html/hs2html.flex b/homework/81906/hs2html/hs2html.flex new file mode 100644 index 00000000..446122fa --- /dev/null +++ b/homework/81906/hs2html/hs2html.flex @@ -0,0 +1,120 @@ +/* scanner for Haskell */ + +%{ +#define YY_NO_UNISTD_H +%} + +DIGIT [0-9] +ID [a-z_]+[A-Za-z0-9_$]* +CLASSNAME [A-Za-z0-9]* +COMMENT --[\(\)\[\]\{\} \w]*\n +STRQ '([^\']|(\\\'))*' +STRDQ \"([^\"]|(\\\"))*\" + +%% + +{DIGIT}+ { + printf("%s", yytext); + } + +{DIGIT}+"."{DIGIT}* { + printf("%s", yytext); + } + +as|case|of|class|data|family|instance|default|deriving|instance|do|forall|foreign|hiding|if|then|else|import|infix|infixl|infixr|instance|let|in|mdo|module|newtype|proc|qualified|rec|type|family|instance|where { + printf("%s", yytext); +} + + +{ID} printf("%s", yytext); +{CLASSNAME} printf("%s", yytext); +{STRQ}|{STRDQ} printf("%s", yytext); +{COMMENT} printf("%s", yytext); + +"=" printf("%s", yytext); +"!" printf("%s", yytext); +"-" printf("%s", yytext); +"+" printf("%s", yytext); +"/" printf("%s", yytext); +"?" printf("%s", yytext); +"." printf("%s", yytext); +">" printf("%s", yytext); +"#" printf("%s", yytext); +"*" printf("%s", yytext); +"@" printf("%s", yytext); +"\\" printf("%s", yytext); +"`" printf("%s", yytext); +"|" printf("%s", yytext); +"~" printf("%s", yytext); +"&" printf("%s", yytext); +"-<" printf("%s", yytext); +"->" printf("%s", yytext); +"::" printf("%s", yytext); +"<-" printf("%s", yytext); +"=>" printf("%s", yytext); +"/=" printf("%s", yytext); +"-<<" printf("%s", yytext); + + + +[;(){}:?,\[\] \t\n]+ printf("%s", yytext); /* echo the rest */ + +. printf( "Unrecognized character: %s\n", yytext ); + +%% + +int yywrap() +{ + return 1; +} + + +int main(int argc, const char* argv[]) +{ + ++argv, --argc; /* skip over program name */ + if ( argc > 0 ) + yyin = fopen( argv[0], "r" ); + else + yyin = stdin; + + puts( + "" + "" + "" + "
"
+ );
+ yylex();
+ puts("");
+ return 0;
+}
diff --git a/homework/81906/hs2html/spaghetti.hs b/homework/81906/hs2html/spaghetti.hs
new file mode 100644
index 00000000..8151ce6b
--- /dev/null
+++ b/homework/81906/hs2html/spaghetti.hs
@@ -0,0 +1,246 @@
+import Prelude
+import Control.Monad
+import Data.List.Split
+
+data File = File {fileName::String, content::String} deriving (Eq, Show)
+data Directory = Directory {dirName::String, subDirectories::[Directory], files::[File]} deriving (Eq, Show)
+
+addDirectory :: Maybe Directory -> String -> Directory
+addDirectory (Just (Directory dirName dirs files)) name =
+ if (getSubDirectory name (Directory dirName dirs files)) == Nothing then
+ Directory dirName (dirs ++ [(Directory name [] [])]) files
+ else
+ (Directory dirName dirs files)
+
+hasFileHelper (File fileName content) targetName =
+ fileName == targetName
+
+hasFile :: [File] -> String -> Maybe File
+hasFile [] _ = Nothing
+hasFile fileList fileName =
+ if hasFileHelper (head fileList) fileName then
+ (Just (head fileList))
+ else
+ hasFile (tail fileList) fileName
+
+
+addFile :: File -> Directory -> Directory
+addFile file (Directory dirName dirs files) =
+ if (hasFile files name) == Nothing then
+ Directory dirName dirs (files ++ [file])
+ else
+ Directory dirName dirs files
+ where name = (fileName file)
+
+splitPath :: String -> [String]
+splitPath path
+ | path !! 0 == '/' = "/":(splitOn "/" (tail path))
+ | path !! 0 == '.' && path !! 1 == '/' = (splitOn "/" (drop 2 path))
+ | path !! 0 == '.' && path !! 1 == '.' && path !! 2 == '/' = "/":(take ((length (splitOn "/" (drop 3 path))) - 1) (splitOn "/" (drop 3 path)))
+ | otherwise = splitOn "/" path
+
+
+splitInput :: String -> [String]
+splitInput input = splitOn " " input
+
+getSubDirectoryHelper :: String -> Directory -> Bool
+getSubDirectoryHelper name directory = name == directoryName
+ where directoryName = dirName directory
+
+getSubDirectory :: String -> Directory -> Maybe Directory
+getSubDirectory name (Directory dirname dirs files)
+ | name == "" = Just (Directory dirname dirs files)
+ | null dirs = Nothing
+ | getSubDirectoryHelper name (head dirs) = Just (head dirs)
+ | otherwise = getSubDirectory name (Directory dirname (tail dirs) files)
+
+
+getDirectory :: [String] -> Maybe Directory -> Maybe Directory
+getDirectory _ Nothing = Nothing
+getDirectory [] (Just mainDirectory) = Just mainDirectory
+getDirectory pathInList (Just mainDirectory) =
+ getDirectory (tail pathInList) (getSubDirectory (head pathInList) mainDirectory)
+
+cd :: String -> Directory -> Directory -> Maybe Directory
+cd path mainDirectory currDirectory =
+ let k = (splitPath path) in
+ if (head k) == "/" then
+ getDirectory (tail k) (Just mainDirectory)
+ else
+ getDirectory k (Just currDirectory)
+
+
+findFileHelper :: Maybe Directory -> String -> Maybe File
+findFileHelper (Just (Directory _ _ files)) fileName = (hasFile files fileName)
+
+findFile :: String -> Directory -> Directory -> Maybe File
+findFile path mainDirectory currDirectory =
+ let k = (splitPath path) in
+ if (head k) == "/" then
+ (findFileHelper (getDirectory (take ((length k) - 2) (tail k)) (Just mainDirectory)) (head (reverse k)))
+ else
+ (findFileHelper (getDirectory (take ((length k) - 1) (tail k )) (Just currDirectory)) (head (reverse k)))
+
+concatContent :: String -> Maybe File -> String
+concatContent result (Just file) = (result ++ (content file))
+
+inputFileContent :: String -> IO String
+inputFileContent result = do
+ input <- getLine
+ if input == "." then
+ return result
+ else
+ inputFileContent (result ++ input ++ "\n")
+
+catGenCurrDir :: String -> String -> Directory -> Directory
+catGenCurrDir fileName fileContent currDirectory = if (hasFile (files currDirectory) fileName) /= Nothing then
+ (addFile (File fileName fileContent) (rm fileName currDirectory))
+ else
+ (addFile (File fileName fileContent) currDirectory)
+
+catInputFileHelper :: [String] -> String -> Directory -> Directory -> String -> IO ()
+catInputFileHelper paths path mainDirectory currDirectory result = do
+ let fileName = (head paths)-- (head (reverse (splitPath (head (tail paths)))))
+ fileContent <- (inputFileContent "")
+ let currDir = catGenCurrDir fileName fileContent currDirectory
+ putStrLn (show currDir)
+ let (Just mainDir) = (changeDirectory (Just mainDirectory) (splitPath path) currDir)
+ directoryRecursion (Just mainDir) path (cd path mainDir mainDir)
+
+catFileAssignHelper :: [String] -> String -> Directory -> Directory -> String -> IO ()
+catFileAssignHelper paths path mainDirectory currDirectory result = do
+ let fileName = (head paths)-- (head (reverse (splitPath path)))
+ let currDir = catGenCurrDir fileName result currDirectory-- (addFile (File fileName result) (rm fileName currDirectory))
+ let (Just mainDir) = (changeDirectory (Just mainDirectory) (splitPath path) currDir)
+ directoryRecursion (Just mainDir) path (cd path mainDir mainDir)
+
+cat :: [String] -> String -> Directory -> Directory -> String -> IO ()
+cat paths path mainDirectory currDirectory result
+ | ((length paths) == 1) && ((head paths) /= ">") && (result == "") =
+ let (Just file) = (findFile (head paths) mainDirectory currDirectory) in putStrLn (content file)
+ | (head paths) == ">" && result /= "" =
+ catFileAssignHelper (tail paths) path mainDirectory currDirectory result
+ | (head paths) == ">" && result == "" =
+ catInputFileHelper (tail paths) path mainDirectory currDirectory result
+ | otherwise = cat (tail paths) path mainDirectory currDirectory (concatContent result (findFile (head paths) mainDirectory currDirectory))
+
+mkdir :: String -> Directory -> Directory
+mkdir name currDirectory = addDirectory (Just currDirectory) name
+
+conCatDirs :: [Directory] -> String -> String
+conCatDirs [] result = result
+conCatDirs dirs result = conCatDirs (tail dirs) (result ++ (dirName (head dirs)) ++ " ")
+
+conCatFiles :: [File] -> String -> String
+conCatFiles [] result = result
+conCatFiles files result = conCatFiles (tail files) (result ++ (fileName (head files)) ++ " ")
+
+conCatStringListHelper :: [String] -> String -> String -> String
+conCatStringListHelper [] _ result = result
+conCatStringListHelper stringList separator result = conCatStringListHelper (tail stringList) separator (result ++ separator ++ (head stringList))
+
+conCatStringList :: [String] -> String -> String
+conCatStringList stringList separator = conCatStringListHelper stringList separator ""
+
+
+ls :: Directory -> IO ()
+ls (Directory dirName dirs files) =
+ putStrLn ((conCatDirs dirs "") ++ (conCatFiles files "") )
+
+contentString :: Directory -> String
+contentString directory = "/"
+
+touch name currDirectory = addFile (File name "") currDirectory
+
+rmDirHelper :: String -> [Directory] -> [Directory]
+rmDirHelper dirname dirs
+ |null dirs = []
+ |dirname == (dirName (head dirs)) = (tail dirs)
+ |otherwise = rmDirHelper dirname (tail dirs)
+
+rmdir :: String -> Directory -> Directory
+rmdir dirName (Directory name dirs files) =
+ Directory name (rmDirHelper dirName dirs) files
+
+rmFileHelper :: String -> [File] -> [File]
+rmFileHelper filename files
+ |null files = []
+ |filename == (fileName (head files)) = (tail files)
+ |otherwise = rmFileHelper filename (tail files)
+
+rm :: String -> Directory -> Directory
+rm fileName (Directory name dirs files) =
+ Directory name dirs (rmFileHelper fileName files)
+
+addDir :: Directory -> Maybe Directory -> Maybe Directory
+addDir _ Nothing = Nothing
+addDir (Directory dirName dirs file) (Just newDirectory) =
+ Just (Directory dirName (dirs ++ [newDirectory]) file)
+
+changeDirectory :: Maybe Directory -> [String] -> Directory -> Maybe Directory
+changeDirectory Nothing _ _ = Nothing
+changeDirectory _ [] changedDirectory = (Just changedDirectory)
+changeDirectory (Just mainDirectory) pathInList changedDirectory =
+ let k = changeDirectory (cd (head pathInList) mainDirectory mainDirectory) (tail pathInList) changedDirectory in
+ if (dirName changedDirectory) == "/" then
+ Just changedDirectory
+ else
+ addDir (rmdir (head pathInList) mainDirectory) k -- Just changedDirectory
+
+rmMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO ()
+rmMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do
+ let changedDirectory = (rm (head (tail inputs)) currDirectory)
+ let pathList = (tail (splitPath path))
+ let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory
+ let newCurrDirectory = (cd path newMainDirectory mainDirectory)
+ directoryRecursion (Just newMainDirectory) path newCurrDirectory
+
+mkdirMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO ()
+mkdirMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do
+ let changedDirectory = (mkdir (head (tail inputs)) currDirectory)
+ let pathList = (tail (splitPath path))
+ let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory
+ let newCurrDirectory = (cd path newMainDirectory mainDirectory)
+ directoryRecursion (Just newMainDirectory) path newCurrDirectory
+
+touchMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO ()
+touchMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do
+ let changedDirectory = (touch (head (tail inputs)) currDirectory)
+ let pathList = (tail (splitPath path))
+ let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory
+ let newCurrDirectory = (cd path newMainDirectory mainDirectory)
+ directoryRecursion (Just mainDirectory) path newCurrDirectory
+
+buildPath :: String -> String -> String
+buildPath path next = if path == "/" then
+ (path ++ next)
+ else
+ (path ++ "/" ++ next)
+
+directoryRecursion :: Maybe Directory -> String -> Maybe Directory -> IO ()
+directoryRecursion (Just mainDirectory) path (Just currDirectory) = do
+ input <- getLine
+ let inputs = splitInput input
+ case head inputs of
+ "cat" -> cat (tail inputs) path mainDirectory currDirectory ""
+ "pwd" -> putStrLn path
+ "rm" -> rmMainHelper inputs (Just mainDirectory) path (Just currDirectory)
+ "mkdir" -> mkdirMainHelper inputs (Just mainDirectory) path (Just currDirectory)
+ "touch" -> touchMainHelper inputs (Just mainDirectory) path (Just currDirectory)
+ "ls" -> ls currDirectory-- same
+ "cd" -> if (cd (head (tail inputs)) mainDirectory currDirectory) == Nothing then
+ (putStrLn "Couldn't find this directory")
+ else
+ let newPath = (buildPath path (head (tail inputs))) in
+ (directoryRecursion (Just mainDirectory) newPath (cd (head (tail inputs)) mainDirectory currDirectory))
+ _ -> putStrLn "Invalid operation!"
+ directoryRecursion (Just mainDirectory) path (Just currDirectory)
+
+main :: IO ()
+main = do
+ let mainDirectory = Directory "/" [] []
+ directoryRecursion (Just mainDirectory) "/" (Just mainDirectory)
+ putStrLn (show mainDirectory)
+ putStrLn "ended"
+ return ()
+
diff --git a/homework/81906/hs2html/spaghetti.html b/homework/81906/hs2html/spaghetti.html
new file mode 100644
index 00000000..32cb0fbb
--- /dev/null
+++ b/homework/81906/hs2html/spaghetti.html
@@ -0,0 +1,248 @@
+ +import Prelude +import Control.Monad +import Data.List.Split + +data File = File {fileName::String, content::String} deriving (Eq, Show) +data Directory = Directory {dirName::String, subDirectories::[Directory], files::[File]} deriving (Eq, Show) + +addDirectory :: Maybe Directory -> String -> Directory +addDirectory (Just (Directory dirName dirs files)) name = + if (getSubDirectory name (Directory dirName dirs files)) == Nothing then + Directory dirName (dirs ++ [(Directory name [] [])]) files + else + (Directory dirName dirs files) + +hasFileHelper (File fileName content) targetName = + fileName == targetName + +hasFile :: [File] -> String -> Maybe File +hasFile [] _ = Nothing +hasFile fileList fileName = + if hasFileHelper (head fileList) fileName then + (Just (head fileList)) + else + hasFile (tail fileList) fileName + + +addFile :: File -> Directory -> Directory +addFile file (Directory dirName dirs files) = + if (hasFile files name) == Nothing then + Directory dirName dirs (files ++ [file]) + else + Directory dirName dirs files + where name = (fileName file) + +splitPath :: String -> [String] +splitPath path + | path !! 0 == '/' = "/":(splitOn "/" (tail path)) + | path !! 0 == '.' && path !! 1 == '/' = (splitOn "/" (drop 2 path)) + | path !! 0 == '.' && path !! 1 == '.' && path !! 2 == '/' = "/":(take ((length (splitOn "/" (drop 3 path))) - 1) (splitOn "/" (drop 3 path))) + | otherwise = splitOn "/" path + + +splitInput :: String -> [String] +splitInput input = splitOn " " input + +getSubDirectoryHelper :: String -> Directory -> Bool +getSubDirectoryHelper name directory = name == directoryName + where directoryName = dirName directory + +getSubDirectory :: String -> Directory -> Maybe Directory +getSubDirectory name (Directory dirname dirs files) + | name == "" = Just (Directory dirname dirs files) + | null dirs = Nothing + | getSubDirectoryHelper name (head dirs) = Just (head dirs) + | otherwise = getSubDirectory name (Directory dirname (tail dirs) files) + + +getDirectory :: [String] -> Maybe Directory -> Maybe Directory +getDirectory _ Nothing = Nothing +getDirectory [] (Just mainDirectory) = Just mainDirectory +getDirectory pathInList (Just mainDirectory) = + getDirectory (tail pathInList) (getSubDirectory (head pathInList) mainDirectory) + +cd :: String -> Directory -> Directory -> Maybe Directory +cd path mainDirectory currDirectory = + let k = (splitPath path) in + if (head k) == "/" then + getDirectory (tail k) (Just mainDirectory) + else + getDirectory k (Just currDirectory) + + +findFileHelper :: Maybe Directory -> String -> Maybe File +findFileHelper (Just (Directory _ _ files)) fileName = (hasFile files fileName) + +findFile :: String -> Directory -> Directory -> Maybe File +findFile path mainDirectory currDirectory = + let k = (splitPath path) in + if (head k) == "/" then + (findFileHelper (getDirectory (take ((length k) - 2) (tail k)) (Just mainDirectory)) (head (reverse k))) + else + (findFileHelper (getDirectory (take ((length k) - 1) (tail k )) (Just currDirectory)) (head (reverse k))) + +concatContent :: String -> Maybe File -> String +concatContent result (Just file) = (result ++ (content file)) + +inputFileContent :: String -> IO String +inputFileContent result = do + input <- getLine + if input == "." then + return result + else + inputFileContent (result ++ input ++ "\n") + +catGenCurrDir :: String -> String -> Directory -> Directory +catGenCurrDir fileName fileContent currDirectory = if (hasFile (files currDirectory) fileName) /= Nothing then + (addFile (File fileName fileContent) (rm fileName currDirectory)) + else + (addFile (File fileName fileContent) currDirectory) + +catInputFileHelper :: [String] -> String -> Directory -> Directory -> String -> IO () +catInputFileHelper paths path mainDirectory currDirectory result = do + let fileName = (head paths)-- (head (reverse (splitPath (head (tail paths))))) + fileContent <- (inputFileContent "") + let currDir = catGenCurrDir fileName fileContent currDirectory + putStrLn (show currDir) + let (Just mainDir) = (changeDirectory (Just mainDirectory) (splitPath path) currDir) + directoryRecursion (Just mainDir) path (cd path mainDir mainDir) + +catFileAssignHelper :: [String] -> String -> Directory -> Directory -> String -> IO () +catFileAssignHelper paths path mainDirectory currDirectory result = do + let fileName = (head paths)-- (head (reverse (splitPath path))) + let currDir = catGenCurrDir fileName result currDirectory-- (addFile (File fileName result) (rm fileName currDirectory)) + let (Just mainDir) = (changeDirectory (Just mainDirectory) (splitPath path) currDir) + directoryRecursion (Just mainDir) path (cd path mainDir mainDir) + +cat :: [String] -> String -> Directory -> Directory -> String -> IO () +cat paths path mainDirectory currDirectory result + | ((length paths) == 1) && ((head paths) /= ">") && (result == "") = + let (Just file) = (findFile (head paths) mainDirectory currDirectory) in putStrLn (content file) + | (head paths) == ">" && result /= "" = + catFileAssignHelper (tail paths) path mainDirectory currDirectory result + | (head paths) == ">" && result == "" = + catInputFileHelper (tail paths) path mainDirectory currDirectory result + | otherwise = cat (tail paths) path mainDirectory currDirectory (concatContent result (findFile (head paths) mainDirectory currDirectory)) + +mkdir :: String -> Directory -> Directory +mkdir name currDirectory = addDirectory (Just currDirectory) name + +conCatDirs :: [Directory] -> String -> String +conCatDirs [] result = result +conCatDirs dirs result = conCatDirs (tail dirs) (result ++ (dirName (head dirs)) ++ " ") + +conCatFiles :: [File] -> String -> String +conCatFiles [] result = result +conCatFiles files result = conCatFiles (tail files) (result ++ (fileName (head files)) ++ " ") + +conCatStringListHelper :: [String] -> String -> String -> String +conCatStringListHelper [] _ result = result +conCatStringListHelper stringList separator result = conCatStringListHelper (tail stringList) separator (result ++ separator ++ (head stringList)) + +conCatStringList :: [String] -> String -> String +conCatStringList stringList separator = conCatStringListHelper stringList separator "" + + +ls :: Directory -> IO () +ls (Directory dirName dirs files) = + putStrLn ((conCatDirs dirs "") ++ (conCatFiles files "") ) + +contentString :: Directory -> String +contentString directory = "/" + +touch name currDirectory = addFile (File name "") currDirectory + +rmDirHelper :: String -> [Directory] -> [Directory] +rmDirHelper dirname dirs + |null dirs = [] + |dirname == (dirName (head dirs)) = (tail dirs) + |otherwise = rmDirHelper dirname (tail dirs) + +rmdir :: String -> Directory -> Directory +rmdir dirName (Directory name dirs files) = + Directory name (rmDirHelper dirName dirs) files + +rmFileHelper :: String -> [File] -> [File] +rmFileHelper filename files + |null files = [] + |filename == (fileName (head files)) = (tail files) + |otherwise = rmFileHelper filename (tail files) + +rm :: String -> Directory -> Directory +rm fileName (Directory name dirs files) = + Directory name dirs (rmFileHelper fileName files) + +addDir :: Directory -> Maybe Directory -> Maybe Directory +addDir _ Nothing = Nothing +addDir (Directory dirName dirs file) (Just newDirectory) = + Just (Directory dirName (dirs ++ [newDirectory]) file) + +changeDirectory :: Maybe Directory -> [String] -> Directory -> Maybe Directory +changeDirectory Nothing _ _ = Nothing +changeDirectory _ [] changedDirectory = (Just changedDirectory) +changeDirectory (Just mainDirectory) pathInList changedDirectory = + let k = changeDirectory (cd (head pathInList) mainDirectory mainDirectory) (tail pathInList) changedDirectory in + if (dirName changedDirectory) == "/" then + Just changedDirectory + else + addDir (rmdir (head pathInList) mainDirectory) k -- Just changedDirectory + +rmMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO () +rmMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do + let changedDirectory = (rm (head (tail inputs)) currDirectory) + let pathList = (tail (splitPath path)) + let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory + let newCurrDirectory = (cd path newMainDirectory mainDirectory) + directoryRecursion (Just newMainDirectory) path newCurrDirectory + +mkdirMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO () +mkdirMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do + let changedDirectory = (mkdir (head (tail inputs)) currDirectory) + let pathList = (tail (splitPath path)) + let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory + let newCurrDirectory = (cd path newMainDirectory mainDirectory) + directoryRecursion (Just newMainDirectory) path newCurrDirectory + +touchMainHelper :: [String] -> Maybe Directory -> String -> Maybe Directory -> IO () +touchMainHelper inputs (Just mainDirectory) path (Just currDirectory) = do + let changedDirectory = (touch (head (tail inputs)) currDirectory) + let pathList = (tail (splitPath path)) + let (Just newMainDirectory) = changeDirectory (Just mainDirectory) pathList changedDirectory + let newCurrDirectory = (cd path newMainDirectory mainDirectory) + directoryRecursion (Just mainDirectory) path newCurrDirectory + +buildPath :: String -> String -> String +buildPath path next = if path == "/" then + (path ++ next) + else + (path ++ "/" ++ next) + +directoryRecursion :: Maybe Directory -> String -> Maybe Directory -> IO () +directoryRecursion (Just mainDirectory) path (Just currDirectory) = do + input <- getLine + let inputs = splitInput input + case head inputs of + "cat" -> cat (tail inputs) path mainDirectory currDirectory "" + "pwd" -> putStrLn path + "rm" -> rmMainHelper inputs (Just mainDirectory) path (Just currDirectory) + "mkdir" -> mkdirMainHelper inputs (Just mainDirectory) path (Just currDirectory) + "touch" -> touchMainHelper inputs (Just mainDirectory) path (Just currDirectory) + "ls" -> ls currDirectory-- same + "cd" -> if (cd (head (tail inputs)) mainDirectory currDirectory) == Nothing then + (putStrLn "Couldn't find this directory") + else + let newPath = (buildPath path (head (tail inputs))) in + (directoryRecursion (Just mainDirectory) newPath (cd (head (tail inputs)) mainDirectory currDirectory)) + _ -> putStrLn "Invalid operation!" + directoryRecursion (Just mainDirectory) path (Just currDirectory) + +main :: IO () +main = do + let mainDirectory = Directory "/" [] [] + directoryRecursion (Just mainDirectory) "/" (Just mainDirectory) + putStrLn (show mainDirectory) + putStrLn "ended" + return () + +