coco
coco copied to clipboard
explicitly close implicit calls
eg f a ^^ b -> f(a)(b). i'm not method chaining
currently, i have to write f(a) b, (f a) b
we may use <| to reflect wirh |>
Current paren-free (but ugly) solutions are:
f a .call null bf a |>& b
use
<|
How'd that help?
a b <| c => a(b) c
That's hardly a reverse of |>; doesn't make sense.
indeed, we can't use $ etc
F♯ you mean?
Another solution:
Function::$ = -> @apply null, arguments
f a .$ b
which imitates Haskell's $.
Huh, that's neat.
F♯ you mean?
thanks - had trouble remembering where it was from
which imitates Haskell's $.
indeed, but -- that's horrendously slow :/.
And another:
Function::<<<_:~->@
f a ._ b
Workarounds aside, I guess we can add it if we can find an intuitive symbol for it. The proposed ^^ doesn't feel quite right.
EDIT : removed the part where I'm dumb.
any suggest ?
f a >< b
sort of looks like the middle parentheses of
( f a )( b )
if you squint.
f a |>& b doesn't help if i want to store the final result:
$ coco -bce 'c = f a |>& b'
var x0$, c;
x0$ = c = f(a);
x0$(b);
not sure if this is a bug
no, that's how refs work
Why aren't we just stealing LiveScript's <|?
a b <| c
That's hardly a reverse of |>; doesn't make sense.
Sure, but does it have to be?
does it have to be what?
Functionally related to |>.
variations: >|, |<
Functionally related to |>.
No I agree and I'd +1 the <| but yeah |> is ref in coco
f a >< bsort of looks like the middle parentheses of( f a )( b )
Nice one. Easily extendable to an existential version: f a >?< b