1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Prettier Evaluatable instance for floats.

This commit is contained in:
Patrick Thomson 2018-04-04 15:40:31 -04:00
parent c7536b6c18
commit 925df74da1

View File

@ -59,8 +59,8 @@ instance Show1 Data.Syntax.Literal.Float where liftShowsPrec = genericLiftShowsP
instance Evaluatable Data.Syntax.Literal.Float where
eval (Float s) =
float =<< case parseScientific s of
Right num -> pure num
case parseScientific s of
Right num -> float num
Left err -> fail ("Parse error: " <> err)
-- Rational literals e.g. `2/3r`