If you use GHC 8.0.2, you have to write it differently, because for these types of types there is regression of type checking. See Notes:
https://downloads.haskell.org/~ghc/8.0.2/docs/html/users_guide/8.0.2-notes.html
So you need to write it like this:
{-
Instead of saying that f has a list type of Int s, you should say that f has a list type of some type a , where a is Int . The language extension {-# LANGUAGE TypeFamilies #-} necessary to ensure type equality. This is not what it was used for, but it is required. Compilation for GHC 8.0.2
source share