Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
head.hackage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alan Zimmerman
head.hackage
Commits
e0bbad0e
Commit
e0bbad0e
authored
5 years ago
by
Alan Zimmerman
Browse files
Options
Downloads
Patches
Plain Diff
Update TH generation for Unit x vs (x)
See
ghc/ghc#17371
parent
43c8ce16
No related branches found
No related tags found
No related merge requests found
Pipeline
#11755
passed
5 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patches/free-5.1.2.patch
+8
-3
8 additions, 3 deletions
patches/free-5.1.2.patch
with
8 additions
and
3 deletions
patches/free-5.1.2.patch
+
8
−
3
View file @
e0bbad0e
diff --git a/src/Control/Monad/Free/TH.hs b/src/Control/Monad/Free/TH.hs
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
--- a/src/Control/Monad/Free/TH.hs
+++ b/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 ++ "'" ]
, "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
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 VarE xs)))
+ return $ Captured tup (LamE (map VarP xs) (TupE (map
+ return $ Captured tup (LamE (map VarP xs) (TupE (map
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment