on master help sign in
Drop support for GHC < 8.0
fed6eb2Erik de Castro Lopo
examples/main/recurrent.hs−4
@@ -9,11 +9,7 @@
9import Control.Monad ( foldM )
9import Control.Monad ( foldM )
10import Control.Monad.Random ( MonadRandom, getRandomR )
10import Control.Monad.Random ( MonadRandom, getRandomR )
11
11
12−#if __GLASGOW_HASKELL__ < 800
13−import Data.List ( unfoldr )
14−#else
15import Data.List ( cycle, unfoldr )
12import Data.List ( cycle, unfoldr )
16−#endif
17import Data.Semigroup ( (<>) )
13import Data.Semigroup ( (<>) )
18
14
19import qualified Numeric.LinearAlgebra.Static as SA
15import qualified Numeric.LinearAlgebra.Static as SA
test/Test/Grenade/Layers/PadCrop.hs−4
@@ -7,10 +7,6 @@
7{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE ScopedTypeVariables #-}
8{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
8{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
9
9
10−#if __GLASGOW_HASKELL__ < 800
11−{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}
12−#endif
13−
14module Test.Grenade.Layers.PadCrop where
10module Test.Grenade.Layers.PadCrop where
15
11
16import Grenade
12import Grenade
test/Test/Grenade/Network.hs−3
@@ -14,9 +14,6 @@ import Control.Monad ( guard )
14import Control.Monad.ST ( runST )
14import Control.Monad.ST ( runST )
15
15
16import Data.Constraint
16import Data.Constraint
17−#if __GLASGOW_HASKELL__ < 800
18−import Data.Proxy
19−#endif
20import qualified Data.Vector.Storable as VS
17import qualified Data.Vector.Storable as VS
21import qualified Data.Vector.Storable.Mutable as VS ( write )
18import qualified Data.Vector.Storable.Mutable as VS ( write )
22import Data.Singletons
19import Data.Singletons
test/Test/Hedgehog/TypeLits.hs+6−15
@@ -8,9 +8,6 @@
8module Test.Hedgehog.TypeLits where
8module Test.Hedgehog.TypeLits where
9
9
10import Data.Constraint
10import Data.Constraint
11−#if __GLASGOW_HASKELL__ < 800
12−import Data.Proxy
13−#endif
14import Data.Singletons
11import Data.Singletons
15
12
16import Hedgehog (Gen)
13import Hedgehog (Gen)
@@ -19,7 +16,7 @@ import qualified Hedgehog.Gen as Gen
19import Grenade
16import Grenade
20
17
21import GHC.TypeLits
18import GHC.TypeLits
22−import GHC.TypeLits.Witnesses
19+import GHC.TypeLits.Witnesses hiding (SNat)
23import Test.Hedgehog.Compat
20import Test.Hedgehog.Compat
24
21
25genNat :: Gen SomeNat
22genNat :: Gen SomeNat
@@ -27,13 +24,7 @@ genNat = do
27 ~(Just n) <- someNatVal <$> choose 1 10
24 ~(Just n) <- someNatVal <$> choose 1 10
28 return n
25 return n
29
26
30−#if __GLASGOW_HASKELL__ < 800
31−type Shape' = ('KProxy :: KProxy Shape)
32−#else
33−type Shape' = Shape
34−#endif
35−
36−genShape :: Gen (SomeSing Shape')
27+genShape :: Gen (SomeSing Shape)
37genShape
28genShape
38 = Gen.choice [
29 = Gen.choice [
39 genD1
30 genD1
@@ -41,20 +32,20 @@ genShape
41 , genD3
32 , genD3
42 ]
33 ]
43
34
44−genD1 :: Gen (SomeSing Shape')
35+genD1 :: Gen (SomeSing Shape)
45genD1 = do
36genD1 = do
46 n <- genNat
37 n <- genNat
47 return $ case n of
38 return $ case n of
48 SomeNat (_ :: Proxy x) -> SomeSing (sing :: Sing ('D1 x))
39 SomeNat (_ :: Proxy x) -> SomeSing (sing :: Sing ('D1 x))
49
40
50−genD2 :: Gen (SomeSing Shape')
41+genD2 :: Gen (SomeSing Shape)
51genD2 = do
42genD2 = do
52 n <- genNat
43 n <- genNat
53 m <- genNat
44 m <- genNat
54 return $ case (n, m) of
45 return $ case (n, m) of
55 (SomeNat (_ :: Proxy x), SomeNat (_ :: Proxy y)) -> SomeSing (sing :: Sing ('D2 x y))
46 (SomeNat (_ :: Proxy x), SomeNat (_ :: Proxy y)) -> SomeSing (sing :: Sing ('D2 x y))
56
47
57−genD3 :: Gen (SomeSing Shape')
48+genD3 :: Gen (SomeSing Shape)
58genD3 = do
49genD3 = do
59 n <- genNat
50 n <- genNat
60 m <- genNat
51 m <- genNat
@@ -64,7 +55,7 @@ genD3 = do
64 case natDict px %* natDict pz of
55 case natDict px %* natDict pz of
65 Dict -> SomeSing (sing :: Sing ('D3 x y z))
56 Dict -> SomeSing (sing :: Sing ('D3 x y z))
66
57
67−rss :: SomeSing Shape' -> String
58+rss :: SomeSing Shape -> String
68rss (SomeSing (r :: Sing s)) = case r of
59rss (SomeSing (r :: Sing s)) = case r of
69 (D1Sing a@SNat) -> "D1 " ++ show (natVal a)
60 (D1Sing a@SNat) -> "D1 " ++ show (natVal a)
70 (D2Sing a@SNat b@SNat) -> "D2 " ++ show (natVal a) ++ " " ++ show (natVal b)
61 (D2Sing a@SNat b@SNat) -> "D2 " ++ show (natVal a) ++ " " ++ show (natVal b)