From 0a4d3c8f12dc5797a919a00b6bcaf759947687cc Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 17 Jun 2018 23:24:47 +0200 Subject: Add ouest france parser --- src/executable/haskell/Utils/Text.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/executable/haskell/Utils/Text.hs (limited to 'src/executable/haskell/Utils/Text.hs') 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 -- cgit v1.2.3