PasteRack.org
Paste # 99646
2014-09-30 14:13:09

Fork as a new paste.

Paste viewed 29 times.


Embed:

  1. #lang typed/racket
  2.  
  3. (define: (parse [xs : (Rec A (Listof (U Symbol A)))]) : (Listof String)
  4.   (map (lambda: ([item : (Rec B (U Symbol (Listof B)))])
  5.          "Hello, world") xs))

=>

eval:2:0: Type Checker: Polymorphic function `map' could not

be applied to arguments:

Types: (-> a c) (Pairof a (Listof a)) -> (Pairof c (Listof

c))

       (-> a b ... b c) (Listof a) (Listof b) ... b ->

(Listof c)

Arguments: (-> (Rec B (U Symbol (Listof B))) String) (Rec A

(Listof (U Symbol A)))

Expected result: (Listof String)

  in: xs