pufuwozu/roy — Issue #73: Formalize/define unit type and/or nullary function definition and evaluation
Author: eegg
Created: 2011-12-13 00:35:33+00:00
State: open

We can write

```haskell
let foo () = 4
let bar = foo ()
```

which generates and calls JS nullary functions. But what exactly is going on here? If this is like Haskell, then `()` is both a value and also the single inhabitant of the type with the same name, as if we were to write

```haskell
data () = ()
```

This would let us write the following in Roy

```haskell
let foo (): () = 4
```

Which generates a parse error. Also, it would generate JS that has some constructor called `()` or something equivalent, where the Roy compiler actually generates a function of no arguments.

It's not just parentheses either, as we can't write

```haskell
let foo (x) = 4
```