From b003d5fac4be1f2e5af4e141b7afb659b6e97351 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 26 Jun 2016 14:11:40 +0200 Subject: minor cleanup --- src/Main.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 169c900..3576a7a 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -382,7 +382,7 @@ printVal = withArg $ \formula -> withFocus $ \focusId -> do outline Nothing = shellPutErrLn "No such value" outline (Just (Map.toList -> [(v, _)])) = shellPutStrLn $ show v outline (Just (sortBy (comparing snd) . Map.toList -> vals)) = mapM_ (shellPutStrLn . outline') vals - outline' (v, prob) = pad' 3 (show $ round' prob) ++ " → " ++ show v - round' :: RealFrac a => a -> Float - round' = (/ 10) . fromIntegral . (round :: RealFrac a => a -> Integer) . (* 10) + outline' (v, prob) = pad' 3 (show $ round' 10 prob) ++ " → " ++ show v + round' :: RealFrac a => Float -> a -> Float + round' n = (/ n) . fromIntegral . (round :: RealFrac a => a -> Integer) . (* n) . realToFrac pad' m ys = replicate (m - length (take m ys)) ' ' ++ ys -- cgit v1.2.3