Actully racket pattern matching syntax has already supported recursion 
scheme(catamorphism):

(define (eval-expr e)
  (match e
    [`(+ ,(app eval-expr e0) ,(app eval-expr e1))
     (+ e0 e1)]
    [`(- ,(app eval-expr e0) ,(app eval-expr e1))
     (- e0 e1)]
    [(? number?) e]
    ))


在 2019年7月15日星期一 UTC+8上午11:21:14,Raoul Schorer写道:
>
> Hi,
>
> I recently became interested in recursion schemes, and I noticed that 
> almost all implementations are in typed languages. I understand the 
> advantage of having an implementation using recursion at the type level, 
> but why is it that there are so few material in untyped languages?
>
> For instance, would a recursion schemes racket lib be useful or is there 
> something I am missing? I noticed that there is no such lib, currently.
>
> Thanks,
> Raoul
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/875f6c82-ab63-48b9-9b89-92fb5330d110%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to