From 7c209f271ffc3122ada0331094e01dc6e409c2fb Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 9 Apr 2017 18:50:36 +0200 Subject: Add search input --- src/Format.purs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/Format.purs') diff --git a/src/Format.purs b/src/Format.purs index bed5927..e8ab661 100644 --- a/src/Format.purs +++ b/src/Format.purs @@ -1,17 +1,15 @@ module Format ( number - , compare + , string , unaccent ) where -import Data.Int (toNumber, fromNumber) import Data.Array (replicate) +import Data.Int (toNumber, fromNumber) import Data.Maybe (fromMaybe) import Data.String (length, joinWith, fromCharArray, toCharArray, toLower) import Math (round, trunc, pow) - -import Prelude hiding (compare) -import Prelude as Prelude +import Prelude number :: Int -> Number -> String number decimalLength num = formattedIntegerPart <> formattedDecimalPart @@ -33,9 +31,8 @@ number decimalLength num = formattedIntegerPart <> formattedDecimalPart else "" -compare :: String -> String -> Ordering -compare xs ys = Prelude.compare (formatString xs) (formatString ys) - where formatString = unaccent <<< toLower +string :: String -> String +string = unaccent <<< toLower unaccent :: String -> String unaccent = fromCharArray <<< map unaccentChar <<< toCharArray -- cgit v1.2.3