pufuwozu/roy — Issue #90: Justify syntactic deviations from Haskell (etc.)
Author: eegg
Created: 2011-12-30 00:33:47+00:00
State: open

Roy currently has a syntax mostly derived from ML-style languages. For each syntactic construct therein, Roy should either follow it, or deviate with a solid justification. There are notable deviations in the Roy syntax that this applies to:

* Supercombinator definitions use the `let` keyword, e.g. `let id x = x`. Functional programmers are used to defining such using just an `=`, as in `id x = x`. The `let` keyword is typically used for let expressions (`let ... in ...`). I see this syntax in Roy as needlessly verbose and a potential cause of problems when and if let expressions are introduced.
* Pattern matching. Currently we use

```haskell
let printSomething m = match m
case (Some x) = console.log x
case None = console.log "Empty"
```

where a Haskell programmer is used to

```haskell
let printSomething m = case m of
Some x → console.log x
None → console.log "Empty"
```

* `:` for type signatures. As lists are likely less fundamental to Roy than they are to most functional languages, and as `:` has a long history in this use (e.g. λ→), I'd agree with this use.