2013-10-27 22:24:23 +00:00
|
|
|
import Data.List.Ordered
|
2013-04-10 21:29:02 -07:00
|
|
|
|
2019-09-12 10:33:56 -07:00
|
|
|
powers :: Int -> [Int]
|
2013-10-27 22:24:23 +00:00
|
|
|
powers m = map (^ m) [0..]
|
2013-04-10 21:29:02 -07:00
|
|
|
|
2019-09-12 10:33:56 -07:00
|
|
|
squares :: [Int]
|
2013-04-10 21:29:02 -07:00
|
|
|
squares = powers 2
|
2019-09-12 10:33:56 -07:00
|
|
|
|
|
|
|
|
cubes :: [Int]
|
2013-04-10 21:29:02 -07:00
|
|
|
cubes = powers 3
|
2019-09-12 10:33:56 -07:00
|
|
|
|
|
|
|
|
foo :: [Int]
|
2013-10-27 22:24:23 +00:00
|
|
|
foo = filter (not . has cubes) squares
|
2013-04-10 21:29:02 -07:00
|
|
|
|
|
|
|
|
main :: IO ()
|
2019-09-12 10:33:56 -07:00
|
|
|
main = print $ take 10 $ drop 20 foo
|