Solutions to Typeclassopedia Ex. 3.3.1?

Would anyone care to share their solution to exercise 3.3.1 in Typeclassopedia? Thanks, -db

The holy source :)
https://hackage.haskell.org/package/base-4.8.1.0/docs/src/GHC.Base.html#line...
https://hackage.haskell.org/package/base-4.8.1.0/docs/src/Data.Either.html#l...
On 27 September 2015 at 20:03, David Banas
Would anyone care to share their solution to exercise 3.3.1 in *Typeclassopedia*?
Thanks, -db
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-- Regards Sumit Sahrawat

On Sun, Sep 27, 2015 at 08:22:55PM +0530, Sumit Sahrawat, Maths & Computing, IIT (BHU) wrote:
The holy source :)
https://hackage.haskell.org/package/base-4.8.1.0/docs/src/GHC.Base.html#line...
https://hackage.haskell.org/package/base-4.8.1.0/docs/src/Data.Either.html#l...
instance Functor (Either a) where fmap _ (Left x) = Left x fmap f (Right y) = Right (f y) `fmap id = id` and `fmap (f . g) = fmap f . fmap g` seem to hold here, no?

Would anyone care to share their solution to exercise 3.3.1 in Typeclassopedia?
participants (4)
-
David Banas
-
Francesco Ariis
-
Phil Ruffwind
-
Sumit Sahrawat, Maths & Computing, IIT (BHU)