I'm new to haskell and I dont know why I'm getting an extra element in a list.
Here's my code:
module Test where
deal list = hand1
where list' = fst(splitAt 4 list)
hand1 = [snd list' | list'<- (zip [0..] list), even (fst list')]
If I were to put in:
Test.deal [1,2,3,4,5,6]
It splits the list to create to create a tuple of two lists one with length of 4: ([1,2,3,4],[5,6])
When I try to get every other element of the first list in the tuple, I get: [1,3,5] instead of [1,3]
Anyone know why it adds the 5 even though it isn't in the list?