(unsafe-require/typed 'untyped [maybe-car (All (a b) (case-> (-> (Pairof a b) a) (-> a a)))])
Sam Tobin-Hochstadt
unread,
Jul 5, 2019, 3:14:49 PM7/5/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ryan Kramer, Racket Users
No, for two reasons. One, currently `require/typed` does not support
function types with two cases that have the same number of arguments.
Second, Typed Racket's subtyping treats that type as a subtype of
`(All (a) (-> a a))`, so your program gives "interesting" results if
we add this line at the end:
(ann ((ann maybe-car (All (a b) (-> a a))) (list 1 2)) (Listof Integer))