
6 May
2017
6 May
'17
5:50 p.m.
Hey Everyone, ich have a algebraic data type: data FunPB a b = FunPB { runFunPB :: a -> (a,[b]) } I got a Monoid Instance instance Monoid (FunPB a b) where mempty = FunPB $ \k -> (k,mempty) mappend pb1 pb2 = FunPB $ \n -> (,) n $ msum . (<$>) (uncurry (flip const).((flip runFunPB) n)) $ [pb1,pb2] Now I need to write a functor instance instance Functor (FunPB a) where fmap f b = ? How can I map over a->(a,[b])? Lg Alex