diff options
Diffstat (limited to 'compiler/src/Files.hs')
-rw-r--r-- | compiler/src/Files.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/src/Files.hs b/compiler/src/Files.hs index 40149e1..1f14e7f 100644 --- a/compiler/src/Files.hs +++ b/compiler/src/Files.hs | |||
@@ -28,7 +28,7 @@ module Files | |||
28 | ) where | 28 | ) where |
29 | 29 | ||
30 | 30 | ||
31 | import Data.List (isPrefixOf, length, subsequences, sortOn) | 31 | import Data.List (isPrefixOf, length, sortOn) |
32 | import Data.Function ((&)) | 32 | import Data.Function ((&)) |
33 | import Data.Functor ((<&>)) | 33 | import Data.Functor ((<&>)) |
34 | import Data.Text (pack) | 34 | import Data.Text (pack) |
@@ -81,7 +81,10 @@ fileName (Path (name:_)) = Just name | |||
81 | fileName _ = Nothing | 81 | fileName _ = Nothing |
82 | 82 | ||
83 | subPaths :: Path -> [Path] | 83 | subPaths :: Path -> [Path] |
84 | subPaths (Path path) = map Path $ subsequences path | 84 | subPaths (Path path) = map Path $ subpaths path |
85 | where | ||
86 | subpaths [] = [] | ||
87 | subpaths full@(_:r) = full : subpaths r | ||
85 | 88 | ||
86 | pathLength :: Path -> Int | 89 | pathLength :: Path -> Int |
87 | pathLength (Path path) = Data.List.length path | 90 | pathLength (Path path) = Data.List.length path |