[racket-dev] case-> and for/sum:

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Fri Jan 4 15:27:25 EST 2013

2013/1/3 Neil Toronto <neil.toronto at gmail.com>:
> I solved it by not using `for/sum' and writing this ridiculous function for
> the recursive base case and the initial values in `x':
>   (: zero-of (case-> (Real -> Real)
>                      (Number -> Number)))
>   (define (zero-of x) 0)
> Fortunately, it should get inlined. I also renamed `U' to `V', because it
> was overshadowing the type name.

Thanks for the solution.

I am very fond of for and friends in Racket code, and
it annoys me to port these constructs to Typed Racket.
I know the goal is for Typed Racket to use the
output of the macro expansion of for and friends,
but maybe it is worth the effort to implement Typed
Racket versions of the most used for-variants?

/Jens Axel

Posted on the dev mailing list.