[ cleanup ] Remove extraneous show and simplify printLn (#2618)

This commit is contained in:
Nil Geisweiller 2022-08-10 23:22:58 +03:00 committed by GitHub
parent a30209d492
commit 719b5ad17f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 25 deletions

View File

@ -138,9 +138,9 @@ threadWait threadID = fromPrim (prim__threadWait threadID)
||| Output something showable to stdout, without a trailing newline.
export
print : (HasIO io, Show a) => a -> io ()
print x = putStr $ show x
print = putStr . show
||| Output something showable to stdout, with a trailing newline.
export
printLn : (HasIO io, Show a) => a -> io ()
printLn x = putStrLn $ show x
printLn = putStrLn . show

View File

@ -4,4 +4,4 @@ function' : Int -> Int
function' x = x + 1
main : IO ()
main = printLn . show $ function' 4
main = printLn $ function' 4

View File

@ -1,7 +1,7 @@
1/1: Building Module' (Module'.idr)
Module'> 2
Module'> Bye for now!
"5"
5
Module'> Loaded file Module'.idr
Module'>
Bye for now!

View File

@ -51,7 +51,7 @@ testLeftRight =
main : IO ()
main =
do
ignore $ traverse (printLn . show) testLookupBetween
ignore $ traverse (printLn . show) testLeftRight
ignore $ traverse printLn testLookupBetween
ignore $ traverse printLn testLeftRight

View File

@ -1,19 +1,19 @@
1/1: Building SortedMapTest (SortedMapTest.idr)
Main> "Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
"Nothing"
Main> Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Main> Bye for now!

File diff suppressed because one or more lines are too long

View File

@ -18,5 +18,5 @@ main =
do
printLn $ factorial 100
printLn $ factorial 10000
printLn $ show $ the (Vect 3 String) ["red", "green", "blue"]
printLn $ the (Vect 3 String) ["red", "green", "blue"]
printLn foo