summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-11-26 03:23:06 +0000
committerIan Lynagh <igloo@earth.li>2011-11-26 16:17:04 +0000
commita40d256b279255dd32badb80c62a11d6f5355f01 (patch)
tree1422a4bca4db030c27e0d2d1a846867c1a0eb369
parent6a9800a5026a8a532d079c00c067bf8b6b055985 (diff)
downloadhaskell-a40d256b279255dd32badb80c62a11d6f5355f01.tar.gz
Small refactoring: Turn a needlessly monadic binding into a let binding
-rw-r--r--compiler/deSugar/DsForeign.lhs12
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/deSugar/DsForeign.lhs b/compiler/deSugar/DsForeign.lhs
index 22a4a7bdde..318d1df44b 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 $