From 7ef9f09c0f3be1cd5e1f38c9abc845abc9ed3639 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 31 Dec 2019 01:39:23 +0100 Subject: compiler: add option to add implicit directory tags GitHub: closes #7 --- compiler/src/Files.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/src/Files.hs') diff --git a/compiler/src/Files.hs b/compiler/src/Files.hs index ed082ba..a6649c8 100644 --- a/compiler/src/Files.hs +++ b/compiler/src/Files.hs @@ -23,7 +23,8 @@ module Files ( FileName, LocalPath, WebPath, Path - , (), (), (<.>), fileName, subPaths, pathLength + , (), (), (<.>) + , fileName, maybeFileName, subPaths, pathLength , localPath, webPath , FSNode(..), AnchoredFSNode(..) , nodePath, nodeName, isHidden, flattenDir, filterDir, readDirectory @@ -80,6 +81,10 @@ file /> (Path path) = Path (path ++ [file]) fileName :: Path -> FileName fileName (Path (name:_)) = name +maybeFileName :: Path -> Maybe FileName +maybeFileName (Path (name:_)) = Just name +maybeFileName _ = Nothing + subPaths :: Path -> [Path] subPaths (Path path) = map Path $ subsequences path -- cgit v1.2.3