mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 02:23:44 +03:00
[ cleanup ] Remove extraneous show and simplify printLn (#2618)
This commit is contained in:
parent
a30209d492
commit
719b5ad17f
@ -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
|
||||
|
@ -4,4 +4,4 @@ function' : Int -> Int
|
||||
function' x = x + 1
|
||||
|
||||
main : IO ()
|
||||
main = printLn . show $ function' 4
|
||||
main = printLn $ function' 4
|
||||
|
@ -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!
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user