Piotr Szulc 347277
Running on students.mimuw
- Adjusting path:
$ PATH=/home/students/inf/PUBLIC/MRJP/bin/:/home/students/inf/PUBLIC/MRJP/ghc-8.2.2/bin:$PATH
- Removing cabal hell
$ rm -rf ~/.ghc ~/.cabal
or storing contents of these folders elsewhere - Update cabal
$ cabal update
- Install dependencies when in lakke's folder
$ cabal install --only-dependencies
- Generate grammar files:
$ make generate_grammar
- Run lakke
$ cabal run lakke
Examples are in folder examples
.
Running programs from examples: $ cabal run lakke examples/good/fibonacci.lk
Implemented all ticks below 20pts and above 20:
-
Typechecker
Notes: Typechecker doesn't check whether function returns anything, it's runtime error:
ex.:
int f() {}
Typechecks ok butint f() { return "hello string"; }
throws typecheck error (examples/bad/typechecker) -
Nested functioncs with static binding (examples/good/nested.lk)
-
Lambdas (examples/good/lambdas)
Notes:
(int) => bool isAgeGreaterThan100Predicate = bool :: (number :: int) -> { return number > 100; };
() => bool
- type of variable: function requring no arguments and returning boolisAgeGreaterThan100Predicate - variable name:
lambdaReturnType :: (argumentName :: argumentType, ...) -> {...}
-
Continue/Break (examples/good/continue_break.lk)