mirror of
https://github.com/HuwCampbell/grenade.git
synced 2024-11-21 21:59:30 +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)
|
||||
ghc-options: -fno-warn-incomplete-patterns
|
||||
cpp-options: -DType=*
|
||||
|
||||
if impl(ghc >= 8.6)
|
||||
default-extensions: NoStarIsType
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
@ -41,7 +42,9 @@ import Control.Monad.Random ( MonadRandom )
|
||||
|
||||
import Data.List ( foldl' )
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core.Shape
|
||||
import Grenade.Core.LearningParameters
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
@ -36,7 +37,9 @@ import Data.Singletons
|
||||
import Data.Singletons.Prelude
|
||||
import Data.Serialize
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core.Layer
|
||||
import Grenade.Core.LearningParameters
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
@ -26,7 +27,10 @@ import Data.Serialize
|
||||
|
||||
import Data.Singletons
|
||||
import GHC.TypeLits
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
|
||||
|
@ -36,7 +36,9 @@ import GHC.TypeLits hiding (natVal)
|
||||
#else
|
||||
import GHC.TypeLits
|
||||
#endif
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Numeric.LinearAlgebra hiding ( uniformSample, konst )
|
||||
import qualified Numeric.LinearAlgebra as LA
|
||||
|
@ -28,7 +28,9 @@ import GHC.TypeLits hiding (natVal)
|
||||
#else
|
||||
import GHC.TypeLits
|
||||
#endif
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
import Grenade.Layers.Internal.Pad
|
||||
|
@ -40,7 +40,9 @@ import GHC.TypeLits hiding (natVal)
|
||||
#else
|
||||
import GHC.TypeLits
|
||||
#endif
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Numeric.LinearAlgebra hiding ( uniformSample, konst )
|
||||
import qualified Numeric.LinearAlgebra as LA
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
@ -23,7 +24,9 @@ import Data.Serialize
|
||||
|
||||
import Data.Singletons
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
|
||||
|
@ -28,7 +28,9 @@ import GHC.TypeLits hiding (natVal)
|
||||
#else
|
||||
import GHC.TypeLits
|
||||
#endif
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
import Grenade.Layers.Internal.Pad
|
||||
|
@ -29,7 +29,9 @@ import GHC.TypeLits hiding (natVal)
|
||||
#else
|
||||
import GHC.TypeLits
|
||||
#endif
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
import Grenade.Layers.Internal.Pooling
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE TypeFamilies #-}
|
||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||
@ -8,7 +9,9 @@ module Grenade.Recurrent.Core.Layer (
|
||||
, RecurrentUpdateLayer (..)
|
||||
) where
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
@ -32,7 +33,9 @@ import Data.Singletons ( SingI )
|
||||
import Data.Singletons.Prelude ( Head, Last )
|
||||
import Data.Serialize
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
import Grenade.Recurrent.Core.Layer
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
@ -18,7 +19,9 @@ import Control.Monad.Random ( MonadRandom, getRandom )
|
||||
|
||||
import Data.Singletons.TypeLits
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Numeric.LinearAlgebra.Static
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
@ -27,7 +28,9 @@ import Data.Serialize
|
||||
import Data.Singletons
|
||||
import GHC.TypeLits
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import Grenade.Core
|
||||
import Grenade.Recurrent.Core
|
||||
|
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
@ -23,7 +24,9 @@ import Data.Proxy
|
||||
import Data.Serialize
|
||||
import Data.Singletons.TypeLits
|
||||
|
||||
#if MIN_VERSION_base(4,9,0)
|
||||
import Data.Kind (Type)
|
||||
#endif
|
||||
|
||||
import qualified Numeric.LinearAlgebra as LA
|
||||
import Numeric.LinearAlgebra.Static
|
||||
|
Loading…
Reference in New Issue
Block a user