Re: [racket-users] Polymorphic functions on Typed Racket classes

2017-07-18 Thread Sourav Datta
On Tuesday, July 18, 2017 at 7:41:05 PM UTC+5:30, Matthias Felleisen wrote: > In essence, TR’s local inference algorithm cannot determine the type of the > sequence you created. It is one of those cases where you need to help along > the type checker with the equivalent of an explicit type

Re: [racket-users] Polymorphic functions on Typed Racket classes

2017-07-18 Thread Matthias Felleisen
In essence, TR’s local inference algorithm cannot determine the type of the sequence you created. It is one of those cases where you need to help along the type checker with the equivalent of an explicit type application: ((inst seq-first Integer) s1) ((inst seq-rest Integer) s1) I have

[racket-users] Polymorphic functions on Typed Racket classes

2017-07-18 Thread Sourav Datta
Hi! I am encountering a type checker error for the following program but not sure exactly what is wrong with it. The program is as follows: #lang typed/racket (define-type (Seq a) (Object [first (-> a)] [rest (-> (Seq a))])) (: seq-first (All