fork download
  1. transform :: (a -> b) -> [a] -> [b]
  2. transform _ [] = []
  3. transform f (x:xs) = f x : transform f xs
  4.  
  5. intStr :: Int -> String
  6. intStr x = show x
  7.  
  8. makeTpl :: a -> (a, a)
  9. makeTpl x = (x, x)
  10.  
  11. --
  12.  
  13. test f = print . transform f
  14.  
  15. main = do
  16. test intStr [1,2,3]
  17. test makeTpl "abc"
  18.  
Success #stdin #stdout 0s 4552KB
stdin
Standard input is empty
stdout
["1","2","3"]
[('a','a'),('b','b'),('c','c')]