Skip to content

Commit 72b0085

Browse files
committed
Typed rules in Shakes
1 parent 93b394f commit 72b0085

2 files changed

Lines changed: 129 additions & 111 deletions

File tree

ghcide/src/Development/IDE/Core/InputPath.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module Development.IDE.Core.InputPath
44
( InputPath
55
, unInputPath
6+
, unsafeMkInputPath
67
, toAllHaskellInput
78
, toNoFileInput
89
, toProjectHaskellInput
@@ -30,6 +31,15 @@ newtype InputPath (i :: InputClass) =
3031
InputPath { unInputPath :: NormalizedFilePath }
3132
deriving newtype (Eq, Hashable, NFData, Show)
3233

34+
-- | Construct an InputPath without checking whether the path belongs to the
35+
-- requested input class.
36+
--
37+
-- This is only for trusted internals that are rehydrating already-typed rule
38+
-- keys from the Shake database. Normal call sites should use the smart
39+
-- constructors below.
40+
unsafeMkInputPath :: NormalizedFilePath -> InputPath i
41+
unsafeMkInputPath = InputPath
42+
3343
-- | Any Haskell source path HLS may inspect.
3444
--
3545
-- This includes generated dependency source files. Rules accepting

0 commit comments

Comments
 (0)