Include instance signatures on instance methods that are set as exercises.

Previously, it was done using comments in the hands-on course to guide through the type. Now, it is machine-checked.

Unfortunately, a difference between 7.6.3 and 7.8.2 means that redundant parentheses cannot be used for some type constructors in types. This is demonstrated by the source file below.

Issue #84

----

{-# LANGUAGE InstanceSigs #-}

{-

The commented lines in the signature below break the 7.6 compiler.

      Method signature does not match class; it should be
      fmap' :: forall a b. (a -> b) -> (t -> a) -> t -> b

The parentheses are placed redundantly on the
type constructor application -- left-associative.

* Fails using GHC 7.6.3
* Works fine using GHC 7.8.2

-}

class Functor' f where
  fmap' ::
    (a -> b)
    -> f a
    -> f b

instance Functor' ((->) t) where
  fmap' ::
    (a -> b)

--  -> (((->) t) a)
--     -> ((->) t a)

--  -> (((->) t) b)
    -> ((->) t b)
  fmap' =
    (.)
Merge branch 'master' of github.com:NICTA/course