aboutsummaryrefslogtreecommitdiff
path: root/src/executable/haskell/Utils/Text.hs
diff options
context:
space:
mode:
authorJoris2018-06-17 23:24:47 +0200
committerJoris2018-06-18 11:13:55 +0200
commit0a4d3c8f12dc5797a919a00b6bcaf759947687cc (patch)
treebcb89781e22c2314bf0c064ebb37cb7f8a362f5c /src/executable/haskell/Utils/Text.hs
parente2a5c7c5c596d057b6fa9c08a8204ce1429cfdc4 (diff)
downloadad-listener-0a4d3c8f12dc5797a919a00b6bcaf759947687cc.tar.gz
ad-listener-0a4d3c8f12dc5797a919a00b6bcaf759947687cc.tar.bz2
ad-listener-0a4d3c8f12dc5797a919a00b6bcaf759947687cc.zip
Add ouest france parser
Diffstat (limited to 'src/executable/haskell/Utils/Text.hs')
-rw-r--r--src/executable/haskell/Utils/Text.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/executable/haskell/Utils/Text.hs b/src/executable/haskell/Utils/Text.hs
new file mode 100644
index 0000000..1297bbd
--- /dev/null
+++ b/src/executable/haskell/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