λ> toList (many (return 1 <|> return 2) :: Stream [Int])
[[],[1],[2],[1,1],[2,1],[1,2],[2,2],[1,1,1],[2,1,1],[1,2,1],[2,2,1],[1,1,2],[2,1,2],[1,2,2],[2,2,2],[1,1,1,1],[2,1,1,1],[1,2,1,1],[2,2,1,1],[1,1,2,1],[2,1,2,1],[1,2,2,1],[2,2,2,1],[1,1,1,2],[2,1,1,2],[1,2,1,2],[2,2,1,2],[1,1,2,2],[2,1,2,2],[1,2,2,2],[2,2,2,2],[1,1,1,1,1],…
The default definitions of
someandmanyfail to converge forStream.It’s possible to come up with definitions of
someandmanythat work better than the default ones:Though perhaps this indicates a deeper problem with the existing definitions of
<$>,<*>, and<|>?