|
1 | 1 |
|
| 2 | +{-# LANGUAGE ExistentialQuantification #-} |
2 | 3 | module Development.IDE.Graph.Database(
|
3 | 4 | Shake.ShakeDatabase,
|
4 |
| - Shake.SomeShakeValue(..), |
| 5 | + SomeShakeValue(..), |
5 | 6 | shakeOpenDatabase,
|
6 | 7 | shakeRunDatabaseForKeys,
|
7 | 8 | Shake.shakeProfileDatabase,
|
8 | 9 | ) where
|
9 | 10 |
|
| 11 | +import Data.Typeable |
10 | 12 | import Development.IDE.Graph.Internal.Action
|
11 | 13 | import Development.IDE.Graph.Internal.Options
|
12 | 14 | import Development.IDE.Graph.Internal.Rules
|
| 15 | +import Development.Shake (ShakeValue) |
| 16 | +import Development.Shake.Classes |
13 | 17 | import qualified Development.Shake.Database as Shake
|
14 | 18 |
|
15 | 19 | shakeOpenDatabase :: ShakeOptions -> Rules () -> IO (IO Shake.ShakeDatabase, IO ())
|
16 | 20 | shakeOpenDatabase a b = Shake.shakeOpenDatabase (fromShakeOptions a) (fromRules b)
|
17 | 21 |
|
| 22 | +data SomeShakeValue = forall k . ShakeValue k => SomeShakeValue k |
| 23 | +instance Eq SomeShakeValue where SomeShakeValue a == SomeShakeValue b = cast a == Just b |
| 24 | +instance Hashable SomeShakeValue where hashWithSalt s (SomeShakeValue x) = hashWithSalt s x |
| 25 | +instance Show SomeShakeValue where show (SomeShakeValue x) = show x |
| 26 | + |
18 | 27 | shakeRunDatabaseForKeys
|
19 |
| - :: Maybe [Shake.SomeShakeValue] -- ^ Set of keys changed since last run |
| 28 | + :: Maybe [SomeShakeValue] |
| 29 | + -- ^ Set of keys changed since last run. 'Nothing' means everything has changed |
20 | 30 | -> Shake.ShakeDatabase
|
21 | 31 | -> [Action a]
|
22 | 32 | -> IO ([a], [IO ()])
|
23 |
| -shakeRunDatabaseForKeys keys a b = Shake.shakeRunDatabaseForKeys keys a (map fromAction b) |
| 33 | +shakeRunDatabaseForKeys _keys a b = |
| 34 | + -- Shake upstream does not accept the set of keys changed yet |
| 35 | + -- https://github.com/ndmitchell/shake/pull/802 |
| 36 | + Shake.shakeRunDatabase a (map fromAction b) |
0 commit comments