I see that (!!) for Data.Stream has arguments reversed, compared to !! on lists. The Haddock comment, however, suggests otherwise. Is the argument reversal intended? - Conal
From Data.Stream:
-- | @xs !! n@ returns the element of the stream @xs@ at index
-- @n@. Note that the head of the stream has index 0.
--
-- /Beware/: passing a negative integer as the first argument will cause
-- an error.
(!!) :: Int -> Stream a -> a
(!!) n (Cons x xs)
| n == 0 = x
| n > 0 = (!!) (n - 1) xs
| otherwise = error "Stream.!! negative argument"