aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Util
diff options
context:
space:
mode:
authorJoris2017-11-28 09:11:19 +0100
committerJoris2017-11-28 09:11:19 +0100
commit49426740e8e0c59040f4f3721a658f225572582b (patch)
tree43e3cf19f35d672734a92648b0038bf48dace778 /common/src/Common/Util
parent554880727d833befab00666c7a4f95611e8370b9 (diff)
Add search for payments
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