
27 May
2007
27 May
'07
10:17 a.m.
apfelmus wrote:
Note that due to parametricity, any function of this type is necessarily either id or _|_. In other words, there are only two functions of type
∀a∀b. (a->b) -> (a->b)
You managed to type ∀ but you couldn't find ⊥ ? OOC, can anybody tell me what ∀ actually means anyway?
That's because the functions has to work for all types a and b in the same way, i.e. it may not even inspect how the given types a or b look like. You need type classes to get a reasonable type for the function you want
memoize :: Memoizable a => (a->b) -> (a->b)
Ah... most optimal!