Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alan Zimmerman
head.hackage
Commits
e0bbad0e
Commit
e0bbad0e
authored
Oct 23, 2019
by
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
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
patches/free-5.1.2.patch
View file @
e0bbad0e
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment