[commit: ghc] master: Unify: Add Outputable instance for UnifyResultM (56f9ef4)

git at git.haskell.org git at git.haskell.org
Fri Oct 30 19:20:22 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/56f9ef414c9d827cd4fccfd7ab2657bced887b3d/ghc

>---------------------------------------------------------------

commit 56f9ef414c9d827cd4fccfd7ab2657bced887b3d
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Fri Oct 30 19:54:22 2015 +0100

    Unify: Add Outputable instance for UnifyResultM
    
    Reviewers: simonpj, austin
    
    Reviewed By: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1389


>---------------------------------------------------------------

56f9ef414c9d827cd4fccfd7ab2657bced887b3d
 compiler/types/Unify.hs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs
index de22066..87681e0 100644
--- a/compiler/types/Unify.hs
+++ b/compiler/types/Unify.hs
@@ -30,6 +30,8 @@ import Type
 import TyCon
 import TypeRep
 import Util ( filterByList )
+import Outputable
+import FastString (sLit)
 
 import Control.Monad (liftM, foldM, ap)
 #if __GLASGOW_HASKELL__ < 709
@@ -475,6 +477,11 @@ tcUnifyTysFG :: (TyVar -> BindFlag)
 tcUnifyTysFG bind_fn tys1 tys2
   = initUM bind_fn (unify_tys tys1 tys2)
 
+instance Outputable a => Outputable (UnifyResultM a) where
+  ppr SurelyApart    = ptext (sLit "SurelyApart")
+  ppr (Unifiable x)  = ptext (sLit "Unifiable") <+> ppr x
+  ppr (MaybeApart x) = ptext (sLit "MaybeApart") <+> ppr x
+
 {-
 ************************************************************************
 *                                                                      *



More information about the ghc-commits mailing list