Numeral: Silence point-free lint errors in Numeral/Helpers.hs

Summary:
While looking at bugfixes for some ES and IT numeral parsing, I was
looking at the Helpers.hs module and figured I'd silence some lint
errors. There are still some name-masking lint issues, but all others
have been fixed.

Reviewed By: chessai

Differential Revision: D27854164

fbshipit-source-id: 5be8d924b033a55608c455074df1c80c8c0019be
This commit is contained in:
Steven Troxler 2021-04-19 16:33:42 -07:00 committed by Facebook GitHub Bot
parent e7f320e0c9
commit 586522b649

View File

@ -74,8 +74,8 @@ parseDouble s
decimalsToDouble :: Double -> Double
decimalsToDouble x =
let xs = filter (\y -> x - y < 0)
. take 10
. iterate (*10) $ 1 in
$ take 10
$ iterate (*10) 1 in
case xs of
[] -> 0
(multiplier : _) -> x / multiplier
@ -136,21 +136,21 @@ oneOf vs = Predicate $ \x ->
withMultipliable :: Token -> Maybe Token
withMultipliable (Token Numeral x@NumeralData{}) =
Just . Token Numeral $ x {multipliable = True}
Just $ Token Numeral $ x {multipliable = True}
withMultipliable _ = Nothing
withGrain :: Int -> Token -> Maybe Token
withGrain g (Token Numeral x@NumeralData{}) =
Just . Token Numeral $ x {grain = Just g}
Just $ Token Numeral $ x {grain = Just g}
withGrain _ _ = Nothing
notOkForAnyTime :: Token -> Maybe Token
notOkForAnyTime (Token Numeral x) =
Just . Token Numeral $ x {okForAnyTime = False}
Just $ Token Numeral $ x {okForAnyTime = False}
notOkForAnyTime _ = Nothing
double :: Double -> Maybe Token
double x = Just . Token Numeral $ NumeralData
double x = Just $ Token Numeral $ NumeralData
{ value = x
, grain = Nothing
, multipliable = False