You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.
Just an issue to discuss pattern matching. Given the difference between hnix and haskell functions.
One thing we can do something where all functions are "anonymous" although they can be bound to names, and names can be within a recursive set. That's how nix works. There's also the use of :, I would prefer to use -> which is more obvious and frees up : to be used for other things (like list deconstruction.
[a, b] -> a + b
(a, b) -> a + b
{a, b} -> a + b
{a, b, ...c) -> a + b
(a: b) -> a + 1
Shall we have \ as a prefix to functions? It would make it easier to parse since we don't have to assume that : is an infix operator compared to Nix: x: x + 1. Although nix makes the left side an equivalent expression. It's just when the : is used, the meanings of the left side data constructors switch from construction to deconstruction.
(Cons a b): a + b
Would mean that Cons is deconstructing.
a: Cons a 1
Would mean that Cons is constructing.
Also like Haskell we would have syntax sugar for multiparmeter functions converted to nested lambdas.
The text was updated successfully, but these errors were encountered:
Just an issue to discuss pattern matching. Given the difference between hnix and haskell functions.
One thing we can do something where all functions are "anonymous" although they can be bound to names, and names can be within a recursive set. That's how nix works. There's also the use of
:
, I would prefer to use->
which is more obvious and frees up:
to be used for other things (like list deconstruction.Shall we have
\
as a prefix to functions? It would make it easier to parse since we don't have to assume that:
is an infix operator compared to Nix:x: x + 1
. Although nix makes the left side an equivalent expression. It's just when the:
is used, the meanings of the left side data constructors switch from construction to deconstruction.Would mean that
Cons
is deconstructing.Would mean that
Cons
is constructing.Also like Haskell we would have syntax sugar for multiparmeter functions converted to nested lambdas.
The text was updated successfully, but these errors were encountered: