diff options
author | Joris | 2017-04-09 18:50:36 +0200 |
---|---|---|
committer | Joris | 2017-04-09 18:50:36 +0200 |
commit | 7c209f271ffc3122ada0331094e01dc6e409c2fb (patch) | |
tree | 9abb5fab0d72dbd6f793595dca8509bae96c5929 /src/Format.purs | |
parent | 69be67a67503c0cb80153510083513f92de952bf (diff) |
Add search input
Diffstat (limited to 'src/Format.purs')
-rw-r--r-- | src/Format.purs | 13 |
1 files changed, 5 insertions, 8 deletions
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 |