I am trying to write a module in F# that will delete every 3rd element from a list and will return a new list without that elements.
for example
let input = [ 1 .. 15 ]
printfn "List with elements eliminated: %A" (Program1.remove input)
which sould give this output
List with elements eliminated: [1; 2; 4; 5; 7; 8; 10; 11; 13; 14]
What i tried so far
module Program1 =
open System
let remove list1=
let collectList = List.iteri (fun i x -> if i%3 <> 0 then x) list1
collectList
[<EntryPoint>]
let main argv =
let list = [ 1; 2; 3]
printfn "new List is %A" (Program1.remove list )
0
Now i am recieving an error and i tried all day to solve it. Thank you in advance