aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'common/src')
-rw-r--r--common/src/Common/Util/Text.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/src/Common/Util/Text.hs b/common/src/Common/Util/Text.hs
index b49fc55..d7f1db4 100644
--- a/common/src/Common/Util/Text.hs
+++ b/common/src/Common/Util/Text.hs
@@ -1,15 +1,16 @@
module Common.Util.Text
( search
- , unaccent
+ , formatSearch
) 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
+search s t = (formatSearch s) `T.isInfixOf` (formatSearch t)
+
+formatSearch :: Text -> Text
+formatSearch = T.toLower . unaccent
unaccent :: Text -> Text
unaccent = T.map unaccentChar