Classes for Functors

Posted on 2016-06-12 by Oleg Grenrus

A short example why you would like explicit dictionaty passing.

-- Explicit
class NFData1 f where
    rnfWith :: (a -> ()) -> f a -> ()

-- Implicit
class NFData1' f where
    rnf1 :: NFData a => f a -> ()

The explicit one is more powerful, but it has its drawbacks too.

Gist source


Site proudly generated by Hakyll