(curry (inst map (U Complex False) String)
         string->number)

... typechecks, but in your expression, you're going to need to handle
the possibility that the pattern variables in `list-rest` pattern are
#f.

- Jon

On Thu, Aug 22, 2019 at 4:15 PM Štěpán Němec <step...@gmail.com> wrote:
>
>
> I have a hard time persuading Typed Racket to accept the expression
> "(curry map string->number)". No amount of type annotations or added
> `inst`s (as recommended by the guide[1]) I could come up with seem to
> help.
>
> Is there a way to make it work?
>
> [1] 
> https://docs.racket-lang.org/ts-guide/caveats.html#%28part._.Type_inference_for_polymorphic_functions%29
>
> Here's an example with a bit more context (solely for illustration
> purposes; I couldn't make the simple expression above work even
> isolated):
>
> (match-let ([(pregexp "#\\d+ +@ +(\\d+),(\\d+): +(\\d+)x(\\d+)"
>                       (list-rest _ (app (curry map string->number)
>                                         (list x y dx dy))))
>              "#1299 @ 414,871: 29x11"])
>   x)
>
> Thank you,
>
>   Štěpán
>
> --
> 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/8736hths88.fsf%40gmail.com.

-- 
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/CAKfDxxwOSK%3DAg0tw%3DtQgvZ9sRrnXt_J7YSz12V1wvLYRusfOzQ%40mail.gmail.com.

Reply via email to