@@ -35,6 +35,9 @@ import GHC.TypeLits hiding (natVal)
36import GHC.TypeLits
36import GHC.TypeLits
38+#if MIN_VERSION_base(4,9,0)
39+import Data.Kind (Type)
39import GHC.TypeLits.Witnesses
42import GHC.TypeLits.Witnesses
40import Test.Hedgehog.Compat
43import Test.Hedgehog.Compat
@@ -46,7 +49,7 @@ import Numeric.LinearAlgebra ( flatten )
46import Numeric.LinearAlgebra.Static ( extract, norm_Inf )
49import Numeric.LinearAlgebra.Static ( extract, norm_Inf )
47import Unsafe.Coerce
50import Unsafe.Coerce
49−data SomeNetwork :: * where
52+data SomeNetwork :: Type where
50 SomeNetwork :: ( SingI shapes, SingI (Head shapes), SingI (Last shapes), Show (Network layers shapes) ) => Network layers shapes -> SomeNetwork
53 SomeNetwork :: ( SingI shapes, SingI (Head shapes), SingI (Last shapes), Show (Network layers shapes) ) => Network layers shapes -> SomeNetwork
52instance Show SomeNetwork where
55instance Show SomeNetwork where
@@ -448,7 +451,7 @@ oneUp =
448 D1Sing SNat ->
451 D1Sing SNat ->
449 let x = 0 :: S ( shape )
452 let x = 0 :: S ( shape )
450 in case x of
453 in case x of
451− ( S1D x' ) -> do
454+ ( S1D x' ) -> do
452 let ex = extract x'
455 let ex = extract x'
453 let len = VS.length ex
456 let len = VS.length ex
454 ix <- choose 0 (len - 1)
457 ix <- choose 0 (len - 1)
@@ -460,7 +463,7 @@ oneUp =
460 D2Sing SNat SNat ->
463 D2Sing SNat SNat ->
461 let x = 0 :: S ( shape )
464 let x = 0 :: S ( shape )
462 in case x of
465 in case x of
463− ( S2D x' ) -> do
466+ ( S2D x' ) -> do
464 let ex = flatten ( extract x' )
467 let ex = flatten ( extract x' )
465 let len = VS.length ex
468 let len = VS.length ex
466 ix <- choose 0 (len - 1)
469 ix <- choose 0 (len - 1)
@@ -472,7 +475,7 @@ oneUp =
472 D3Sing SNat SNat SNat ->
475 D3Sing SNat SNat SNat ->
473 let x = 0 :: S ( shape )
476 let x = 0 :: S ( shape )
474 in case x of
477 in case x of
475− ( S3D x' ) -> do
478+ ( S3D x' ) -> do
476 let ex = flatten ( extract x' )
479 let ex = flatten ( extract x' )
477 let len = VS.length ex
480 let len = VS.length ex
478 ix <- choose 0 (len - 1)
481 ix <- choose 0 (len - 1)