betaveros / noulith

*slaps roof of [programming language]* this bad boy can fit so much [syntax sugar] into it
1.13k stars 20 forks source link

Unsolicited suggestions? #3

Closed tom-huntington closed 1 year ago

tom-huntington commented 1 year ago

Generic from with

An chaining operator like elixir's |> but appends additional arguments i.e. a zip b <| c <| d is a zip with b with c with d is zip(a, b, c, d).

I think <| will look nice when you want to provide an argument per line:

a zip b
  <| c
  <| d
  ;

Function parameters should be the last parameter

When you inline function arguments with multi-line lambdas, any arguments following multi line lambda become unreadable. i.e. from start in the following:

rng fold (\accum, el ->
(
    # multi line
    # lambda
)) from start;

So I think having fold1 :: [a] -> (a -> a -> a) -> a and fold :: [a] -> a -> (a -> a -> a) -> a is better alternative than an optional from as you could write:

rng fold start <| (\accum, el ->
(
    # multi line
    # lambda
));

Good luck with this language 👍.