summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2016-06-26 14:11:40 +0200
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2016-06-26 14:11:40 +0200
commitb003d5fac4be1f2e5af4e141b7afb659b6e97351 (patch)
tree349339280d0a88c27b967ec268e852862f994e50 /src
parent9ef12374ecf08d052ac8cf24c0f5c8b47d016e3c (diff)
download2017-01-16_17:13:37-b003d5fac4be1f2e5af4e141b7afb659b6e97351.tar
2017-01-16_17:13:37-b003d5fac4be1f2e5af4e141b7afb659b6e97351.tar.gz
2017-01-16_17:13:37-b003d5fac4be1f2e5af4e141b7afb659b6e97351.tar.bz2
2017-01-16_17:13:37-b003d5fac4be1f2e5af4e141b7afb659b6e97351.tar.xz
2017-01-16_17:13:37-b003d5fac4be1f2e5af4e141b7afb659b6e97351.zip
minor cleanup
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs6
1 files changed, 3 insertions, 3 deletions
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
382 outline Nothing = shellPutErrLn "No such value" 382 outline Nothing = shellPutErrLn "No such value"
383 outline (Just (Map.toList -> [(v, _)])) = shellPutStrLn $ show v 383 outline (Just (Map.toList -> [(v, _)])) = shellPutStrLn $ show v
384 outline (Just (sortBy (comparing snd) . Map.toList -> vals)) = mapM_ (shellPutStrLn . outline') vals 384 outline (Just (sortBy (comparing snd) . Map.toList -> vals)) = mapM_ (shellPutStrLn . outline') vals
385 outline' (v, prob) = pad' 3 (show $ round' prob) ++ " → " ++ show v 385 outline' (v, prob) = pad' 3 (show $ round' 10 prob) ++ " → " ++ show v
386 round' :: RealFrac a => a -> Float 386 round' :: RealFrac a => Float -> a -> Float
387 round' = (/ 10) . fromIntegral . (round :: RealFrac a => a -> Integer) . (* 10) 387 round' n = (/ n) . fromIntegral . (round :: RealFrac a => a -> Integer) . (* n) . realToFrac
388 pad' m ys = replicate (m - length (take m ys)) ' ' ++ ys 388 pad' m ys = replicate (m - length (take m ys)) ' ' ++ ys