Commit e0bbad0e authored by Alan Zimmerman's avatar Alan Zimmerman
Browse files

Update TH generation for Unit x vs (x)

See ghc/ghc#17371
parent 43c8ce16
Pipeline #11755 passed with stage
in 92 minutes and 59 seconds
diff --git a/src/Control/Monad/Free/TH.hs b/src/Control/Monad/Free/TH.hs
index 1a5ace9..856bb39 100644
index 1a5ace9..225de20 100644
--- a/src/Control/Monad/Free/TH.hs
+++ b/src/Control/Monad/Free/TH.hs
@@ -112,7 +112,13 @@ mkArg (VarT n) t
@@ -110,9 +110,17 @@ mkArg (VarT n) t
[ "expected final return type `" ++ pprint n ++ "'"
, "but got `" ++ pprint name ++ "'"
, "in a constructor's argument type: `" ++ pprint t ++ "'" ]
let tup = foldl AppT (TupleT $ length ts) ts
- let tup = foldl AppT (TupleT $ length ts) ts
+ let tup = case ts of
+ [t'] -> t'
+ _ -> foldl AppT (TupleT $ length ts) ts
xs <- mapM (const $ newName "x") ts
- return $ Captured tup (LamE (map VarP xs) (TupE (map VarE xs)))
+ return $ Captured tup (LamE (map VarP xs) (TupE (map
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment