Fix GHC 7.8.3: MatchGroup now has 4 args

Rather than use a pattern match, this patch opts to explicitly extract
the fields of interest using where syntax. This keeps compatibility
across GHC 7.8 releases.

Ref: eeaea2df3f (diff-259092edcc59456f526cdef255c181d1L909)
This commit is contained in:
Alejandro Cabrera 2014-07-11 01:12:36 -04:00
parent 17dfe6b63e
commit daada0d27e
1 changed files with 4 additions and 2 deletions

View File

@ -280,8 +280,10 @@ class HasType a where
instance HasType (LHsBind Id) where
#if __GLASGOW_HASKELL__ >= 708
getType _ (L spn FunBind{fun_matches = MG _ in_tys out_typ}) = return $ Just (spn, typ)
where typ = mkFunTys in_tys out_typ
getType _ (L spn FunBind{fun_matches = m}) = return $ Just (spn, typ)
where in_tys = mg_arg_tys m
out_typ = mg_res_ty m
typ = mkFunTys in_tys out_typ
#else
getType _ (L spn FunBind{fun_matches = MatchGroup _ typ}) = return $ Just (spn, typ)
#endif