PasteRack.org | ||
Paste # 72188 | ||
2015-01-26 16:23:00 | ||
Fork as a new paste. | ||
Paste viewed 92 times. | ||
Tweet | ||
Embed: | ||
Welcome to Racket v6.1.1.8. -> (let () (: x (Listof (U #f String))) (define x (list "foo" "bar")) (if (car x) (string-append (first x)) "")) - : String "foo" -> (let () (: x (Listof (U #f String))) (define x (list "foo" "bar")) (if (first x) (string-append (first x)) "")) ; readline-input:1:94: Type Checker: Polymorphic function `car' could not be ; applied to arguments: ; Argument 1: ; Expected: (U Null (Pairof a b)) ; Given: (Listof (U False String)) ; Result type: (a : ((! False @ (car) (0 0)) | (False @ (car) (0 0))) : ; (car (0 0))) ; Expected result: String ; in: (first x) ; [,bt for context]