inst is the way to go. How did you use it? This seems to work fine for me.

#lang typed/racket

(: create-points : (Listof Flonum) (Listof Flonum) -> (Listof
(Vectorof Flonum)))
(define (create-points xs ys)
  (map (inst vector Flonum) xs ys))


On Sun, Jun 30, 2019 at 1:03 AM greadey <grea...@gmail.com> wrote:

> Hi all,
>
> I have a function - create-points- which takes two lists of Flonum and
> yields a list of vector pairs suitable for passing to Racket's plot
> function.
>
> In un-typed code I can just do;
>
> (define (create-points xs ys)
>   (map vector xs ys))
>
> and voila!  It works.  However the only way I have managed to get it to
> type check is by wrapping the vector function in a lambda;
>
> (: create-points : (Listof Flonum) (Listof Flonum) -> (Listof (Vectorof
> Flonum))
>
> (define (create-points xs ys)
>   (map  (lambda ([x : Flonum] [y : Flonum]) (vector x y)) xs ys)).
>
> I have tried using an inst form, but I cannot seem to get that to work.
> Question is thought, is wrapping the vector function in a lambda the only
> way to do this?
>
> Cheers,
>
> greadey
>
> --
> 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/b6192278-03b1-4720-a3c2-72a915e6c959%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-users/b6192278-03b1-4720-a3c2-72a915e6c959%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CADcuegvU8MgGhz8LhmDn-UEQY1kH1ipD3-QmNrd%3DR6W7zDd_QA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to