c***@gmail.com
9 years ago
I think I have a puzzle for you: is it possible to make a gate ++hask such
that (f 1 2 3) and ((((hask f) 1) 2) 3) are the same? We have ++cury and
++curr, but you have to manually curry each parameter.
I've been playing around trying to get this working for a while now, and
have been hitting snags (including one that looks like it looped the type
system...), since you have to propagate the current sample type forward in
the initial core but STOP chaining if you reach the end. There's also the
slight problem in that samples are improper lists so you can't tell the
difference between @ -> @ -> @ and (@ @) -> @
My attempt so far unfortunately type-fails at the second param :(
:- %say
|= [^ ~ ~]
:- %noun
|^
=+ a=(hask f)
((a 1) 2)
++ hask
|* a=_|=(* **)
?: ?=(^ +<.a)
|= b=_+<-.a
...(a |=(c=_+<+.a ((cury a b) c)))
|= b=_+<.a
(a b)
::
++ f
|= [a=@ b=@ c=@]
:(mul a b c)
--
that (f 1 2 3) and ((((hask f) 1) 2) 3) are the same? We have ++cury and
++curr, but you have to manually curry each parameter.
I've been playing around trying to get this working for a while now, and
have been hitting snags (including one that looks like it looped the type
system...), since you have to propagate the current sample type forward in
the initial core but STOP chaining if you reach the end. There's also the
slight problem in that samples are improper lists so you can't tell the
difference between @ -> @ -> @ and (@ @) -> @
My attempt so far unfortunately type-fails at the second param :(
:- %say
|= [^ ~ ~]
:- %noun
|^
=+ a=(hask f)
((a 1) 2)
++ hask
|* a=_|=(* **)
?: ?=(^ +<.a)
|= b=_+<-.a
...(a |=(c=_+<+.a ((cury a b) c)))
|= b=_+<.a
(a b)
::
++ f
|= [a=@ b=@ c=@]
:(mul a b c)
--
--
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "urbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urbit-dev+***@googlegroups.com.
To post to this group, send email to urbit-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.