Skip to content

Commit

Permalink
Remove superfluous constraints in the derived instances
Browse files Browse the repository at this point in the history
  • Loading branch information
UnkindPartition committed Mar 16, 2013
1 parent c9a92f0 commit 6be85d3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Data/Generics/Traversable/TH.hs
Expand Up @@ -86,12 +86,11 @@ deriveGTraversable name = do
funD 'gtraverse [ clause [] (normalB $ gtraverseExpr typeName) [] ]
]

context = sequence $ gtraversableContext ++ userContext
context = sequence userContext

types = filter (/= appliedType) $ nub [ t | (_,_,ts) <- constructors, t <- ts ]
types = nub [ t | (_,_,ts) <- constructors, t <- ts ]

userContext = [ classP ctx [pure t] | t <- appliedType : types ]
gtraversableContext = [ classP ''GTraversable [varT ctx, pure t] | t <- types ]
userContext = [ classP ctx [pure t] | t <- types ]

sequence [inst]

Expand Down

0 comments on commit 6be85d3

Please sign in to comment.