I'm a beginner in Haskell and I'm trying to make a simple program that takes a list e.g [-3,8]
and makes the infinite list: [-3,8,-3,8,-3,8,...]
Thanks to Haskell's lazy evaluation I've written a very simple program that computes it:
period :: [a]->[a]
period p = p ++ period p
I would like to know if exists a more simple solution using high order functions (iterate, map,...)
cycle
). – Bakuriu