[commit: ghc] wip/gadtpm: Fit everything in 80 columns (7afa6e5)

git at git.haskell.org git at git.haskell.org
Mon Feb 1 06:53:07 UTC 2016


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

On branch  : wip/gadtpm
Link       : http://ghc.haskell.org/trac/ghc/changeset/7afa6e5c1e99cbe18a8b546841efb94dff2e3dfd/ghc

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

commit 7afa6e5c1e99cbe18a8b546841efb94dff2e3dfd
Author: George Karachalias <george.karachalias at gmail.com>
Date:   Fri Jan 29 17:40:18 2016 +0100

    Fit everything in 80 columns


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

7afa6e5c1e99cbe18a8b546841efb94dff2e3dfd
 compiler/deSugar/Check.hs | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index 0ae5a31..b963990 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -307,13 +307,15 @@ translatePat fam_insts pat = case pat of
 
   -- list
   ListPat ps ty Nothing -> do
-    foldr (mkListPatVec ty) [nilPattern ty] <$> translatePatVec fam_insts (map unLoc ps)
+    foldr (mkListPatVec ty) [nilPattern ty]
+      <$> translatePatVec fam_insts (map unLoc ps)
 
   -- overloaded list
   ListPat lpats elem_ty (Just (pat_ty, _to_list))
     | Just e_ty <- splitListTyConApp_maybe pat_ty
     , (_, norm_elem_ty) <- normaliseType fam_insts Nominal elem_ty
-         -- elem_ty is frequently something like `Item [Int]`, but we prefer `Int`
+         -- elem_ty is frequently something like
+         -- `Item [Int]`, but we prefer `Int`
     , norm_elem_ty `eqType` e_ty ->
         -- We have to ensure that the element types are exactly the same.
         -- Otherwise, one may give an instance IsList [Int] (more specific than
@@ -505,14 +507,15 @@ cantFailPattern _ = False
 
 -- | Translate a guard statement to Pattern
 translateGuard :: FamInstEnvs -> GuardStmt Id -> PmM PatVec
-translateGuard _         (BodyStmt   e _ _ _) = translateBoolGuard e
-translateGuard _         (LetStmt      binds) = translateLet (unLoc binds)
-translateGuard fam_insts (BindStmt p e _ _ _) = translateBind fam_insts p e
-translateGuard _         (LastStmt        {}) = panic "translateGuard LastStmt"
-translateGuard _         (ParStmt         {}) = panic "translateGuard ParStmt"
-translateGuard _         (TransStmt       {}) = panic "translateGuard TransStmt"
-translateGuard _         (RecStmt         {}) = panic "translateGuard RecStmt"
-translateGuard _         (ApplicativeStmt {}) = panic "translateGuard ApplicativeLastStmt"
+translateGuard fam_insts guard = case guard of
+  BodyStmt   e _ _ _ -> translateBoolGuard e
+  LetStmt      binds -> translateLet (unLoc binds)
+  BindStmt p e _ _ _ -> translateBind fam_insts p e
+  LastStmt        {} -> panic "translateGuard LastStmt"
+  ParStmt         {} -> panic "translateGuard ParStmt"
+  TransStmt       {} -> panic "translateGuard TransStmt"
+  RecStmt         {} -> panic "translateGuard RecStmt"
+  ApplicativeStmt {} -> panic "translateGuard ApplicativeLastStmt"
 
 -- | Translate let-bindings
 translateLet :: HsLocalBinds Id -> PmM PatVec



More information about the ghc-commits mailing list