> On Jun 12, 2015, at 5:52 PM, Alexander D. Knauth <alexan...@knauth.org> wrote:
> 
> 
> On Jun 12, 2015, at 8:30 PM, 'John Clements' via users-redirect 
> <us...@plt-scheme.org> wrote:
> 
>> Here’s the type I want to write:
>> 
>> (define-type (HuffJsexpr T)
>> (U T (HashTable Symbol HuffJsexpr)))
> 
> 
> Do you mean this?
> (define-type (HuffJsexpr T)
>  (U T (HashTable Symbol (HuffJsexpr T))))

D’oh! Can’t believe I missed that.

Actually, I also can’t believe that TR allowed me to use a type constructor 
without an argument like that.

Thanks!


John

> 
> #lang typed/racket
> (define-type (HuffJsexpr T)
>  (U T (HashTable Symbol (HuffJsexpr T))))
> (: x : (HuffJsexpr String))
> (define x
>  #hash([a . "a string"]
>        [b . #hash([c . #hash()]
>                   [d . "another string"])]
>        [e . #hash([f . "and another"])]))
> 

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to