Someone wrote in [personal profile] deniok 2016-02-07 06:43 pm (UTC)


{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}

class Rotcnuf f where
    mfap :: f (a -> b) -> a -> f b

instance Functor f => Rotcnuf f where
    mfap = flip (fmap . flip ($))


=> Любой Rotcnuf это Functor. Но не наоборот. fmap никак не выразить через mfap - у тебя есть объект типа f a, а в mfap нужно подать f (a -> b).

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting