Apply a callback to an array: Difference between revisions

Line 404:
 
=={{header|Haskell}}==
 
===List===
{{works with|GHC}}
let square x = x*x
Line 415 ⟶ 417:
let printSquares = putStr.unlines.map (show.square)
printSquares values
 
===Array===
{{works with|GHC}}
import Data.Array.IArray
let square x = x*x
let values = array (1,10) [(i,i)|i <- [1..10]] :: Array Int Int
amap square values
 
=={{header|IDL}}==
Anonymous user