I'm interested in creating a new Haskell container type (strict lists), and I want to make sure that operations on them are eligible for stream fusion. How do I opt-in to ghc's stream fusion capability?
If my container is Traversable
, will it fuse automatically? If I implemented, say, mapAccumL
in terms of toList
, will Haskell be smart enough to not convert the container to a List at all, instead simply operating on the underlying representation?