Type signatures are optional in Haskell, but in OCaml you can even specify partial signatures (e.g. just one parameter).
Maybe return types are more valuable to annotate? I can often guess params based on the name, but I have to read the function body for the result.
miniblog.
Related Posts
I'm writing a Path type in my programming language but not sure what methods belong on a Path.
Should I have some_path.read_string() or fs::read_string(some_path) instead?
I love .method() for IDE completion, but I don't want Path to be cluttered. I'm also trying to avoid UFCS.
I've been iterating further on how Garden shows type errors.
For types in the standard library, I'm now showing "a String" but "an Int". I'm also doing basic syntax highlighting of the code excerpt.
What do you think?
What types should you infer when code is invalid?
In Garden, + only applies to integers. What should the type of "x" + "y" be?
(1) Int: This produces cascading errors.
(2) String: We've already emitted an error anyway.
(3) Bottom.
Opinions?