mirror of
https://github.com/HuwCampbell/grenade.git
synced 2024-11-22 06:55:13 +03:00
support GHC 7.10
- no `Data.Kind` module in this old GHC, so use CPP for conditional include - also use CPP to define `Type=*` for backward compatibility
This commit is contained in:
parent
49a4280a91
commit
8d5ef502be
@ -57,6 +57,7 @@ library
|
|||||||
|
|
||||||
if impl(ghc < 8.0)
|
if impl(ghc < 8.0)
|
||||||
ghc-options: -fno-warn-incomplete-patterns
|
ghc-options: -fno-warn-incomplete-patterns
|
||||||
|
cpp-options: -DType=*
|
||||||
|
|
||||||
if impl(ghc >= 8.6)
|
if impl(ghc >= 8.6)
|
||||||
default-extensions: NoStarIsType
|
default-extensions: NoStarIsType
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
@ -41,7 +42,9 @@ import Control.Monad.Random ( MonadRandom )
|
|||||||
|
|
||||||
import Data.List ( foldl' )
|
import Data.List ( foldl' )
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core.Shape
|
import Grenade.Core.Shape
|
||||||
import Grenade.Core.LearningParameters
|
import Grenade.Core.LearningParameters
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE BangPatterns #-}
|
{-# LANGUAGE BangPatterns #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
@ -36,7 +37,9 @@ import Data.Singletons
|
|||||||
import Data.Singletons.Prelude
|
import Data.Singletons.Prelude
|
||||||
import Data.Serialize
|
import Data.Serialize
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core.Layer
|
import Grenade.Core.Layer
|
||||||
import Grenade.Core.LearningParameters
|
import Grenade.Core.LearningParameters
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
@ -26,7 +27,10 @@ import Data.Serialize
|
|||||||
|
|
||||||
import Data.Singletons
|
import Data.Singletons
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
|
|
||||||
|
@ -36,7 +36,9 @@ import GHC.TypeLits hiding (natVal)
|
|||||||
#else
|
#else
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
#endif
|
#endif
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Numeric.LinearAlgebra hiding ( uniformSample, konst )
|
import Numeric.LinearAlgebra hiding ( uniformSample, konst )
|
||||||
import qualified Numeric.LinearAlgebra as LA
|
import qualified Numeric.LinearAlgebra as LA
|
||||||
|
@ -28,7 +28,9 @@ import GHC.TypeLits hiding (natVal)
|
|||||||
#else
|
#else
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
#endif
|
#endif
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
import Grenade.Layers.Internal.Pad
|
import Grenade.Layers.Internal.Pad
|
||||||
|
@ -40,7 +40,9 @@ import GHC.TypeLits hiding (natVal)
|
|||||||
#else
|
#else
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
#endif
|
#endif
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Numeric.LinearAlgebra hiding ( uniformSample, konst )
|
import Numeric.LinearAlgebra hiding ( uniformSample, konst )
|
||||||
import qualified Numeric.LinearAlgebra as LA
|
import qualified Numeric.LinearAlgebra as LA
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
@ -23,7 +24,9 @@ import Data.Serialize
|
|||||||
|
|
||||||
import Data.Singletons
|
import Data.Singletons
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
|
|
||||||
|
@ -28,7 +28,9 @@ import GHC.TypeLits hiding (natVal)
|
|||||||
#else
|
#else
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
#endif
|
#endif
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
import Grenade.Layers.Internal.Pad
|
import Grenade.Layers.Internal.Pad
|
||||||
|
@ -29,7 +29,9 @@ import GHC.TypeLits hiding (natVal)
|
|||||||
#else
|
#else
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
#endif
|
#endif
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
import Grenade.Layers.Internal.Pooling
|
import Grenade.Layers.Internal.Pooling
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE TypeFamilies #-}
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
@ -8,7 +9,9 @@ module Grenade.Recurrent.Core.Layer (
|
|||||||
, RecurrentUpdateLayer (..)
|
, RecurrentUpdateLayer (..)
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
@ -32,7 +33,9 @@ import Data.Singletons ( SingI )
|
|||||||
import Data.Singletons.Prelude ( Head, Last )
|
import Data.Singletons.Prelude ( Head, Last )
|
||||||
import Data.Serialize
|
import Data.Serialize
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
import Grenade.Recurrent.Core.Layer
|
import Grenade.Recurrent.Core.Layer
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
@ -18,7 +19,9 @@ import Control.Monad.Random ( MonadRandom, getRandom )
|
|||||||
|
|
||||||
import Data.Singletons.TypeLits
|
import Data.Singletons.TypeLits
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Numeric.LinearAlgebra.Static
|
import Numeric.LinearAlgebra.Static
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
@ -27,7 +28,9 @@ import Data.Serialize
|
|||||||
import Data.Singletons
|
import Data.Singletons
|
||||||
import GHC.TypeLits
|
import GHC.TypeLits
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import Grenade.Core
|
import Grenade.Core
|
||||||
import Grenade.Recurrent.Core
|
import Grenade.Recurrent.Core
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE BangPatterns #-}
|
{-# LANGUAGE BangPatterns #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
@ -23,7 +24,9 @@ import Data.Proxy
|
|||||||
import Data.Serialize
|
import Data.Serialize
|
||||||
import Data.Singletons.TypeLits
|
import Data.Singletons.TypeLits
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,9,0)
|
||||||
import Data.Kind (Type)
|
import Data.Kind (Type)
|
||||||
|
#endif
|
||||||
|
|
||||||
import qualified Numeric.LinearAlgebra as LA
|
import qualified Numeric.LinearAlgebra as LA
|
||||||
import Numeric.LinearAlgebra.Static
|
import Numeric.LinearAlgebra.Static
|
||||||
|
Loading…
Reference in New Issue
Block a user