Re: [stack] Combining Combinators

"Christopher Diggins" <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On 6/19/07, Manfred Von Thun <[email protected]> wrote:
> On 19/6/07 1:05 AM, "William Tanksley, Jr" <[email protected]> wrote:
>
> > Manfred Von Thun <[email protected]> wrote:
>
> > At level zero there are numbers, chars, truth values, lists...
> >> At level one there are functions successor, +, and ...
> >> At level two there are combinators, functions which take functions
> >> as arguments (or as values): map, fold, and many more.
> >> I was looking for something at level three: functions which
> >> take combinators as arguments, but which are distinct from
> >> combinators themselves.
> >
> > How would that distinction be achieved? You hint below that
> > third-order entities would NOT take a function as a parameter; but I
> > must point out that every combinator IS a function.
>
> Yes, every combinator is a function. My wording was too cryptic
> perhaps. I'll try again:
>
> At level one there are functions which take zero level entities
> as arguments.

In Cat this would be the set of functions with types matching: ('A 'b -> 'C)

> At level two there are combinators which take
> level one entities as arguments but cannot take level zero
> entities as arguments. Examples: dip, nullary, map, filter, fold.

These have types that match the pattern: ('A ('B -> 'C) -> 'D)

> At level three there would be functions which take level two
> entities as arguments but cannot take level one entities as
> arguments.

These would have types: ('A ('B ('C -> 'D) -> 'E) -> 'F)

In Cat, unlike Joy, level two combinators are never also level one
combinators.

> If there are such things at all, let foo be one of them.
> Then the first below would be meaningful, but the second would not:
>
> 2 3 [+] [nullary] foo
> 2 3 [+] foo
>
> >> I never found any that are distinct
> >> from the existing bunch of Joy combinators.
> >
> > Those are complete, right?
>
> It may or may not have to do with any kind of completeness, I do
> not know. The existing bunch seems to be pretty useful. But I was
> not looking for new level two entities, I was looking for genuinely
> level three entities which are not also level two.
>
> >> a strange new world to me. But it has not led to any combinator
> >> N (for Œnew¹) such that [C] N is meaningful for a combinator [C]
> >> but [Q] N is not meaningful for a non-combinator Q. This
> >> is what I meant by a higher order combinator. But I do not have
> >> a proof that there cannot be such a beast.
> >
> > It seems to me that you want a function which takes combinators as
> > arguments, but does not take functions (right?). But because all
> > combinators _are_ functions, this can't be possible.
>
> If there are the kind of thing I was looking for, this would open
> up enormous possibilities and complications, not necessarily
> pleasant ones. So I did not really want them. I was pleased (and
> often surprised) when I found ways in which existing combinators
> C, D can be combined as in [C] D. So nothing third level. But
> it is stillan open question as far as I can see.

Is:

DEFINE f = [[dip] cons] dip.

A level-3 combinator in Joy? In general I think the secret to creating
a level-3 combinator would be to apply a level-2 combinator to the
result of calling a level-2 combinator.

If you are concerned about eliminating any possibility of level-3
combinators in Joy, can't you rewrite the definitions of the level-2
primitives so that they accept combinators or non-combinators? I don't
see the reason that "dip" can't accept straight values like "5" on the
top of the stack, if "i" can accept them. A definition of "dip" as
"swap unit cons i" should be equivalent shouldn't it? In which case
you wouldn't actually be able to say "dip" is a level-2 combinator. Or
am I missing something here?

I believe it is either good to go all the way one direction or the
other: either non-combinator values can be "evaluated" or they can't.
As far as I can see (and I could be mistaken) Joy is somewhat
ambiguous about what exactly can and can't be evaluated.

Hopefully I am not sticking my foot in my mouth here.

Cheers,
Christopher


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/concatenative/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/concatenative/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.