News for hackers. Stuff that matters.
Re:Rating 26 years of Java changes by miningape on Saturday October 11, 2025 @08:49PM (#45554109)
I don't mean Java annotations, those would be too clunky - in OCaml a type annotation is really just adding `: <typename>` to variables, function return types, etc.

so fibonacci could look like this

```

let rec fib n =

  match n with

  | 0 -> 1

  | 1 -> 1

  | _ -> fib (n - 1) + fib (n - 2)
```

or with annotations it becomes this:

```

let rec fib (n: int): int =

  // Same as above :)
```

There are no comments on this comment yet.