Apologies if this is formatted strangely... replying via broken webmail.
>> > In Cat "dup apply" has the type "(A (A (B -> C) -> D) -> D)"
>>
>> I'm not convinced this is useful. As a trivial example, it assigns
>> '[swap] dup apply' the type 'A b -> A (C -> D) b'. Your system then
>> rejects this type because (C -> D) is unknowable.
>
> You are incorrect.
> Cat infers the type as: ('a -> ('b 'c -> 'c 'b) 'a)
> Why would you claim otherwise?
My derivation is at the end of the email. I've yet to actually use the Cat
interpreter so perhaps I made an incorrect assumption.
Out of curiosity, what type does Cat give '[swap] dup'? Is it not 'A -> A
(B c d -> B d c) (B c d -> B d c)'? If not, why?
>> I was speaking here primarily from a pedagogical standpoint. With
>> macros, you can no longer state that every space-delineated token is a
>> function.
>
> This is already not the case in Joy or Cat. (e.g. in Cat "define",
> "[", "]", "{", "}").
Yes, yes. I meant that '3' is a function, '[1 2 3]' is a function, et
cetera. Replace "token" with "valid syntactic entity" or some such.
- John
;; (initial composition)
E -> E (F g h -> F h g) ;; [swap]
A (A (B -> C) -> D ) -> D ;; dup apply
;; D -> F h g
E -> E (F g h -> F h g)
A (A (B -> C) -> F h g) -> F h g
;; h -> (B -> C)
E -> E (F g (B -> C) -> F (B -> C) g)
A (A (B -> C) -> F (B -> C) g) -> F (B -> C) g
;; A -> F g
E -> E (F g (B -> C) -> F (B -> C) g)
F g (F g (B -> C) -> F (B -> C) g) -> F (B -> C) g
;; E -> F g
F g -> F g (F g (B -> C) -> F (B -> C) g)
F g (F g (B -> C) -> F (B -> C) g) -> F (B -> C) g
F g -> F (B -> C) g
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.