In Haskell map is
map :: (a->b) -> [a] -> [b]
@type("(a->b) -> [a] -> [b]") def myMap(fn, as): #...etc...
@type(Fun(gen.a, gen.b), [gen.a], ret=[gen.b]) def myMap ...etc...
In Haskell map is
How could we do something like that in a Python type extension? One way would be to just use the Haskell notation in quotes: An alternative would be to define a function Fun for describing functional types, and gen.{something} for a generic type, e.g.: But that notation doesn't (at least to me) look as clean as the Haskell.