From 10a9aa9391ac2995527557d9d808693b57236603 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 12 Apr 2015 22:46:56 +0200 Subject: Ignore lines beginning with # in the configuration file --- src/Utils/Text.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/Utils/Text.hs (limited to 'src/Utils/Text.hs') diff --git a/src/Utils/Text.hs b/src/Utils/Text.hs new file mode 100644 index 0000000..1297bbd --- /dev/null +++ b/src/Utils/Text.hs @@ -0,0 +1,13 @@ +module Utils.Text + ( startsWith + ) where + +import Data.Text (Text) +import qualified Data.Text as T + +startsWith :: Text -> Text -> Bool +startsWith mbStart text = + case (T.uncons mbStart, T.uncons text) of + (Just (x, xs), Just (y, ys)) -> x == y && startsWith xs ys + (Nothing, _) -> True + _ -> False -- cgit v1.2.3