[racket] Typed Racket - Parameterized Structures

From: Ray Racine (ray.racine at gmail.com)
Date: Wed Mar 14 07:40:02 EDT 2012


I could use an assist on getting the following to type check.

#lang typed/racket/base

(struct: (All T0 T1) Cvt ([cvt : (T0 -> T1)]))

(: cvt-apply (All (T0 T1) T0 (Cvt T0 T1) -> T1))
(define (cvt-apply value cvt)
  ((Cvt-cvt cvt) value))

(: ItoS-Convert (Cvt Integer String))
(define ItoS-Convert
  (Cvt (λ: ((x : Integer)) "Hello")))

(: ItoS (Integer -> String))
(define (ItoS int)
  (cvt-apply int ItoS-Convert))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120314/075fa0ba/attachment-0001.html>

Posted on the users mailing list.