diff options
author | Iavor S. Diatchki <diatchki@galois.com> | 2013-05-30 19:57:24 -0700 |
---|---|---|
committer | Iavor S. Diatchki <diatchki@galois.com> | 2013-05-31 09:22:57 -0700 |
commit | da345e4c2cc32f299f8131dfff2bb6de6bca2ee1 (patch) | |
tree | 855359c15375330902d781afce4d536783079226 /compiler/prelude | |
parent | fc9229df0835a5a767e337672cf766e971ec871e (diff) | |
download | haskell-da345e4c2cc32f299f8131dfff2bb6de6bca2ee1.tar.gz |
Use the symmetric version of the newtype coercion.
Diffstat (limited to 'compiler/prelude')
-rw-r--r-- | compiler/prelude/PrelRules.lhs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs index 50730e2d5e..78ff3f0b1d 100644 --- a/compiler/prelude/PrelRules.lhs +++ b/compiler/prelude/PrelRules.lhs @@ -47,7 +47,7 @@ import BasicTypes import DynFlags import Platform import Util -import Coercion (mkUnbranchedAxInstCo) +import Coercion (mkUnbranchedAxInstCo,mkSymCo) import Control.Monad import Data.Bits as Bits @@ -994,12 +994,12 @@ match_inline _ = Nothing -- for a description of what is going on here. match_magicSingI :: [Expr CoreBndr] -> Maybe (Expr CoreBndr) match_magicSingI (Type t : e : Lam b _ : _) - | ([_,_,fu],_) <- splitFunTys t - , (sI_type,_) <- splitFunTy fu - , Just (sI_tc,xs) <- splitTyConApp_maybe sI_type - , Just (_,_,co) <- unwrapNewTyCon_maybe sI_tc + | ((_ : _ : fu : _),_) <- splitFunTys t + , (sI_type,_) <- splitFunTy fu + , Just (sI_tc,xs) <- splitTyConApp_maybe sI_type + , Just (_,_,co) <- unwrapNewTyCon_maybe sI_tc = Just $ let f = setVarType b fu - in Lam f $ Var f `App` Cast e (mkUnbranchedAxInstCo co xs) + in Lam f $ Var f `App` Cast e (mkSymCo (mkUnbranchedAxInstCo co xs)) match_magicSingI _ = Nothing |