Open krainboltgreene opened 7 years ago
Now I'm starting to like arrows:
point: (x) -> (y) -> [x, y]
Hmm, also I think:
point: (x) ƒ (y) ƒ [x, y]
or
point: (x) ƒ (y) ƒ
[x, y]
Also, calling functions maybe force the argument to have the name?
point(x: 4)(y: 3)
vs
point(4)(3)
I've seen a lot of languages do pipe operators so you can do:
a(b(c))
as
a
|> b
|> c
But I'm wondering how this would look in bee, this a first pass:
>- pullAccounts >- mapValues(path(["attributes", "created-at")) >- moment
>- pullAccounts
>- mapValues(path(["attributes", "created-at"))
>- moment
This is interesting because it's the opposite of ->
.
Oh, also, with that we can also do promises as >>-
and actors as >>>-
Type annotations for functions
# store_printer: UUID -> String -> Cookies -> String
store_printer:
id ->
station ->
cookies ->
cookies fetch(station) fetch(id)
Defining a function will return a Function object. A Function can only take one argument, but that argument can be an Index List or Pair List.
Single line function definitions are expressed thusly:
For multiple arguments you can express it thusly:
Defaults can be expressed as such:
Multiline functions are expressed thusly (Only the last line is returned):
Function invocation is expressed thusly:
For multiple arguments you would express it thusly:
Of course for currying you would express thusly:
And currying with multiline is express thusly: