Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove superfluous constraints in the derived instances

  • Loading branch information...
commit 6be85d3d4febc8f09e50222d9c89c181e24e366a 1 parent c9a92f0
Roman Cheplyaka authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 Data/Generics/Traversable/TH.hs
7 Data/Generics/Traversable/TH.hs
View
@@ -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]
Please sign in to comment.
Something went wrong with that request. Please try again.