|
|
|
|
|
by some_thoughts
1106 days ago
|
|
So I have very little experience with elixir, but I appreciate the effort to bring static typing. With that said, I find the use of parenthesis pretty hard to read. As in I need to spend more time than a quick glance to grok what's going on. Maybe it's because I'm not familiar with the ecosystem, but coming from a typescript, python, and go background mostly, I find this negate :: ((integer() -> integer()) and
(true -> false) and (false -> true) and
(a -> a) when a: not(integer() or boolean())) harder to reason about quickly than say this negate :: (int -> int) & (true -> false) & (false -> true) & (a -> a)
when a: ~(int | boolean) Is there a reason that syntax was chosen? Is it just for showcasing purposes or is that basically just how the language works? |
|
You will for sure be able to drop the outer parens in your case and you _may_ be able to drop them on the function types too (to be decided). Ending up with something like this:
We will also allow intersections to be broken across multiple declarations: