
25 Dec
2015
25 Dec
'15
6:32 p.m.
why am i getting warning in the following code?? though it works perfectly!!! Prelude> newtype Pair1 c b a=Pair1 {getPair1 :: (a,b,c)} Prelude> :{ Prelude| instance Functor (Pair1 m n) where Prelude| fmap f (Pair1 (x,y,z))=Pair1 (f x,y,z) Prelude| :} <interactive>:55:10: Warning: No explicit implementation for ‘Prelude.fmap’ In the instance declaration for ‘Functor (Pair1 m n)’ -- The below shows it is working fine! Prelude> getPair1 $ fmap (*100) (Pair1 (2,3,1)) (200,3,1)