I have course for Haskell programming at my university. And I must implement my own datatype "Stream" and its some functional:
data Stream a = a :> Stream a
I have problems to implement a function "streamToList":
streamToList :: Stream a -> [a]
It must take an object of "Stream" and return an infinite list. But I don't know how to take elements of this object. How can I take the elements of this stream?
Also, I want to ask: what is the way to initialize an object of this datatype?