3 ms·
> To make a similar version in Haskell you'd have to use a language extension (MultiParamTypeClasses?) and the type signature would be significantly more comple
by burntsushi 13y ago
> To make a similar version in Haskell you'd have to use a language extension (MultiParamTypeClasses?) and the type signature would be significantly more complex.
Eh? No language extensions necessary.
fmap :: Functor f => (a -> b) -> f a -> f b
Perhaps I'm missing something though...
- lmm 13y agoThat can only be used with a fixed functor f; the scala version can send an (a -> b) to a (f a -> that), for any [a, b, that] combination for which a CanBuildFrom is available (this is basically a more generalized typeclass).