diff options
author | Joris | 2019-08-07 21:27:59 +0200 |
---|---|---|
committer | Joris | 2019-08-07 21:27:59 +0200 |
commit | fc8be14dd0089eb12b78af7aaaecd8ed57896677 (patch) | |
tree | 22bcd64c7ef3f21aa067ca81824f0e0a2ce6b631 /common/src/Common/Util | |
parent | bc81084933f8ec1bfe6c2834defd12243117fdd9 (diff) |
Update category according to payment in add overlay
Diffstat (limited to 'common/src/Common/Util')
-rw-r--r-- | common/src/Common/Util/Text.hs | 9 |
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 |