aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Util
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/Common/Util')
-rw-r--r--common/src/Common/Util/Text.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/src/Common/Util/Text.hs b/common/src/Common/Util/Text.hs
index 7e5c8c2..b49fc55 100644
--- a/common/src/Common/Util/Text.hs
+++ b/common/src/Common/Util/Text.hs
@@ -1,10 +1,16 @@
module Common.Util.Text
- ( unaccent
+ ( search
+ , unaccent
) where
import Data.Text (Text)
import qualified Data.Text as T
+search :: Text -> Text -> Bool
+search s t =
+ (format s) `T.isInfixOf` (format t)
+ where format = T.toLower . unaccent
+
unaccent :: Text -> Text
unaccent = T.map unaccentChar