[Solved] How can I calculate a power of 1..n on Haskell? [closed]


main = do
  nStr <- getLine
  let n = read nStr
  print . take n $ map (^2) [1..]

Stack overflow is inappropriate for questions that have not been well-researched. Hit LYAH, RWH, the Haskell wikibook, or a combination of the two before you post here.

solved How can I calculate a power of 1..n on Haskell? [closed]