aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/src/Files.hs7
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
31import Data.List (isPrefixOf, length, subsequences, sortOn) 31import Data.List (isPrefixOf, length, sortOn)
32import Data.Function ((&)) 32import Data.Function ((&))
33import Data.Functor ((<&>)) 33import Data.Functor ((<&>))
34import Data.Text (pack) 34import Data.Text (pack)
@@ -81,7 +81,10 @@ fileName (Path (name:_)) = Just name
81fileName _ = Nothing 81fileName _ = Nothing
82 82
83subPaths :: Path -> [Path] 83subPaths :: Path -> [Path]
84subPaths (Path path) = map Path $ subsequences path 84subPaths (Path path) = map Path $ subpaths path
85 where
86 subpaths [] = []
87 subpaths full@(_:r) = full : subpaths r
85 88
86pathLength :: Path -> Int 89pathLength :: Path -> Int
87pathLength (Path path) = Data.List.length path 90pathLength (Path path) = Data.List.length path