Wondering about Typeclasses

This is more a lack of higher-kinded types than type classes, though. I would be fine with writing

mapIntsToStrings : ((a -> b) -> f a -> f b) -> f Int -> f String
mapIntsToStrings fmap = fmap String.fromInt

So you get the added abstraction power without the implicit parameters type classes essentially provide. (And you need these for (your example using) type classes anyway.)

1 Like