{-# LANGUAGE InstanceSigs #-} class Monoid' a where mempty' :: a mappend' :: a -> a -> a class MyFunctor f where my_fmap :: (a -> b) -> f a -> f b instance MyFunctor Maybe where my_fmap :: (a -> b) -> Maybe a -> Maybe b my_fmap f Nothing = Nothing my_fmap f (Just x) = Just (f x) instance MyFunctor [] where my_fmap :: (a -> b) -> [a] -> [b] my_fmap f [] = [] my_fmap f (x:xs) = f x : my_fmap f xs