Import hs-plugins cvs
This commit is contained in:
13
examples/printf/001/Main.hs
Normal file
13
examples/printf/001/Main.hs
Normal file
@ -0,0 +1,13 @@
|
||||
import Printf
|
||||
|
||||
main = do
|
||||
printf "%d\n" $> (42 :: Int) ! []
|
||||
printf "0x%X\n" $> (42 :: Int) ! []
|
||||
printf "%f\n" $> (42.1234 :: Double) ! []
|
||||
printf "%c:%c:%c\n" $> 'a' ! 'b' ! 'c' ! []
|
||||
printf "%s\n" $> "haskell" ! []
|
||||
printf "%-010.4d\n" $> (42 :: Int) ! []
|
||||
printf "%010.4f\n" $> (42.1234 :: Double) ! []
|
||||
printf "%10.4s\n" $> (show (7 :: Int)) ! []
|
||||
printf "%-10.4s\n" $> "haskell" ! []
|
||||
|
2
examples/printf/001/Makefile
Normal file
2
examples/printf/001/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
TOP=../../..
|
||||
include ../../eval.mk
|
9
examples/printf/001/expected
Normal file
9
examples/printf/001/expected
Normal file
@ -0,0 +1,9 @@
|
||||
42
|
||||
0x2A
|
||||
42.123400
|
||||
a:b:c
|
||||
haskell
|
||||
42
|
||||
00042.1234
|
||||
7
|
||||
hask
|
Reference in New Issue
Block a user