Reputation: 11113
In Haskell (and chicken scheme) you can declare constrained types,
for example map :: (a -> b) -> [a] -> [b]
declares
that map
will take a list containing the type of the function input, and return a list containing the function output.
Is the same possible in common lisp function declarations?
Could I do something analogous like this:
(declaim (ftype (function (function (a) b)
(list a))
(list b)
map))
"you can't do that" would be a satisfactory answer :)
Upvotes: 1
Views: 215