# clean-compiler The [Clean][clean] compiler. The official Clean compiler can be found at [https://svn.cs.ru.nl/repos/clean-compiler/][cocl]. This is a fork to implement experimental new features. --- ## Contents 1\. [Syntactic sugar](#1-syntactic-sugar) 1.1. [Lambda-case](#11-lambda-case) 2\. [Syntax changes](#2-syntax-changes) 2.1. [Use of the `module` keyword](#21-use-of-the-module-keyword) --- ## 1. Syntactic sugar ### 1.1. Lambda-case Similar to [GHC's LambdaCase][ghclambdacase], this is a sugar for lambda expressions where the argument is only used in a `case .. of` expression. For example, ```clean \case of 0 = "zero" 1 = "one" _ = "many" ``` is transformed to ```clean \x -> case x of 0 = "zero" 1 = "one" _ = "many" ``` where `x` is a fresh variable. The extension to the grammar: ``` LambdaAbstr = ... | \case of {CaseAltDef}+ ``` ## 2. Syntax changes ### 2.1. Use of the `module` keyword The `module` keyword is only a keyword on the topmost level. This allows for using it as a record field, for example: ```clean :: MyType = { module :: Int } ``` However, it is not allowed to define a function named `module`. [clean]: http://clean.cs.ru.nl [cocl]: https://svn.cs.ru.nl/repos/clean-compiler/ [ghclambdacase]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#lambda-case