on master help sign in
Use StandaloneDeriving
df10d4aCsongor Kiss
generic-lens.cabal+1−1
@@ -150,7 +150,7 @@ benchmark generic-lens-bench
150
150
151 , base >= 4.9 && <= 5.0
151 , base >= 4.9 && <= 5.0
152 , QuickCheck
152 , QuickCheck
153− , criterion
153+ , criterion < 1.3.0.0 && >= 1.2.0.0
154 , deepseq
154 , deepseq
155 , lens
155 , lens
156
156
test/Bifunctor.hs+11−8
@@ -1,10 +1,11 @@
1−{-# LANGUAGE DataKinds #-}
1+{-# LANGUAGE DataKinds #-}
2−{-# LANGUAGE DefaultSignatures #-}
2+{-# LANGUAGE DefaultSignatures #-}
3−{-# LANGUAGE DeriveAnyClass #-}
3+{-# LANGUAGE DeriveAnyClass #-}
4−{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE DeriveGeneric #-}
5−{-# LANGUAGE FlexibleContexts #-}
5+{-# LANGUAGE FlexibleContexts #-}
6−{-# LANGUAGE MonoLocalBinds #-}
6+{-# LANGUAGE MonoLocalBinds #-}
7+{-# LANGUAGE StandaloneDeriving #-}
7−{-# LANGUAGE TypeApplications #-}
8+{-# LANGUAGE TypeApplications #-}
8
9
9module Main (main) where
10module Main (main) where
10
11
@@ -21,7 +22,9 @@ main = void $ runTestTT $
21data Tree a w = Leaf a
22data Tree a w = Leaf a
22 | Fork (Tree a w) (Tree a w)
23 | Fork (Tree a w) (Tree a w)
23 | WithWeight (Tree a w) w
24 | WithWeight (Tree a w) w
24− deriving (Show, Eq, Generic, Bifunctor)
25+ deriving (Show, Eq, Generic)
26+
27+deriving instance Bifunctor (Tree a w)
25
28
26mytree :: Tree Int Int
29mytree :: Tree Int Int
27mytree = Fork (WithWeight (Leaf 42) 1)
30mytree = Fork (WithWeight (Leaf 42) 1)