Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/a40d256b279255dd32badb80c62a11d6f5355f01

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

commit a40d256b279255dd32badb80c62a11d6f5355f01
Author: Ian Lynagh <[email protected]>
Date:   Sat Nov 26 03:23:06 2011 +0000

    Small refactoring: Turn a needlessly monadic binding into a let binding

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

 compiler/deSugar/DsForeign.lhs |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/compiler/deSugar/DsForeign.lhs b/compiler/deSugar/DsForeign.lhs
index 22a4a7b..318d1df 100644
--- a/compiler/deSugar/DsForeign.lhs
+++ b/compiler/deSugar/DsForeign.lhs
@@ -299,13 +299,11 @@ dsFExport fn_id co ext_name cconv isDyn = do
        -- Look at the result type of the exported function, orig_res_ty
        -- If it's IO t, return         (t, True)
        -- If it's plain t, return      (t, False)
-    (res_ty,             -- t
-     is_IO_res_ty) <-    -- Bool
-        case tcSplitIOType_maybe orig_res_ty of
-           Just (_ioTyCon, res_ty) -> return (res_ty, True)
-                   -- The function already returns IO t
-           Nothing                    -> return (orig_res_ty, False)
-                   -- The function returns t
+       (res_ty, is_IO_res_ty) = case tcSplitIOType_maybe orig_res_ty of
+                                -- The function already returns IO t
+                                Just (_ioTyCon, res_ty) -> (res_ty, True)
+                                -- The function returns t
+                                Nothing                 -> (orig_res_ty, False)
 
     dflags <- getDOpts
     return $



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to