fork download
  1. skipEachN n l = zipWith (!!) l [0, n - 1 ..]
  2.  
  3. main = do
  4. print $ skipEachN 5 [1..50]
  5. print $ take 10 $ skipEachN 5 [1..]
  6.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:4:21:
    No instance for (Enum [a])
      arising from the arithmetic sequence `1 .. 50' at prog.hs:4:21-27
    Possible fix: add an instance declaration for (Enum [a])
    In the second argument of `skipEachN', namely `[1 .. 50]'
    In the second argument of `($)', namely `skipEachN 5 ([1 .. 50])'
    In the expression: print $ skipEachN 5 ([1 .. 50])

prog.hs:4:22:
    No instance for (Num [a])
      arising from the literal `1' at prog.hs:4:22
    Possible fix: add an instance declaration for (Num [a])
    In the expression: 1
    In the second argument of `skipEachN', namely `[1 .. 50]'
    In the second argument of `($)', namely `skipEachN 5 ([1 .. 50])'

prog.hs:5:31:
    No instance for (Enum [a1])
      arising from the arithmetic sequence `1 .. ' at prog.hs:5:31-35
    Possible fix: add an instance declaration for (Enum [a1])
    In the second argument of `skipEachN', namely `[1 .. ]'
    In the second argument of `($)', namely `skipEachN 5 ([1 .. ])'
    In the second argument of `($)', namely
        `take 10 $ skipEachN 5 ([1 .. ])'

prog.hs:5:32:
    No instance for (Num [a1])
      arising from the literal `1' at prog.hs:5:32
    Possible fix: add an instance declaration for (Num [a1])
    In the expression: 1
    In the second argument of `skipEachN', namely `[1 .. ]'
    In the second argument of `($)', namely `skipEachN 5 ([1 .. ])'
stdout
Standard output is empty