Various Haskell 2010 stream comonads.
Data.Stream.Future provides a coinductive anti-causal stream, or non-empty
ZipList. The comonad provides access to only the
tail of the stream. Like a conventional
ZipList, this is not a monad.
data Future a = Last a | a :< Future a
Data.Stream.Future.Skewprovides a non-empty skew-binary random-access-list with the semantics of
Data.Stream.Future. As with
Data.Stream.Futurethis stream is not a
Monad, since the
Applicativeinstance zips streams of potentially differing lengths. The random-access-list structure provides a number of operations logarithmic access time, but makes
Data.Stream.Future.Skew.consless productive. Where applicable
Data.Stream.Infinite.Skewmay be more efficient, due to a lazier and more efficient
Data.Stream.Infiniteprovides a coinductive infinite anti-causal stream. The
Comonadprovides access to the tail of the stream and the
Applicativezips streams together. Unlike
Future, infinite stream form a
Monad. The monad diagonalizes the
Stream, which is consistent with the behavior of the
Applicative, and the view of a
Streamas a isomorphic to the reader monad from the natural numbers. Being infinite in length, there is no
data Stream a = a :< Stream a
Data.Stream.Infinite.Skewprovides an infinite skew-binary random-access-list with the semantics of
Data.Stream.InfiniteSince every stream is infinite, the
Applicativeinstance can be considerably less strict than the corresponding instance for
Data.Stream.Future.Skewand performs asymptotically better.
Data.Stream.Infinite.Functional.Zipperprovides a bi-infinite sequence, represented as a pure function with an accumulating parameter added to optimize moving the current focus.
data Zipper a = !Integer :~ (Integer -> a)
Data.Stream.Supplyprovides a comonadic supply of unique values, which are generated impurely as the tree is explored.
Absurdinstances for infinite streams.
- Add a
head :: Stream a -> afunction to
- Removed a number of redundant parts of the API. If a method you were using has been removed, consider the classes available. No functionality was lost.
- Better support for GHC 7.10, the
Foldable (length, null)members are now defined directly leading to asymptotic improvements and helping to further shrink the API.
- Bug fix in
- Add support for
semigroupoids5 and GHC 7.10
- Switched to
adjunctions. Note: this reversed the argument order to
- Proper upper bounds on dependencies.
- Marked modules appropriately Trustworthy
- Removed intra-package dependency bounds for my packages
- Build system improvements
- IRC Buildbot notification
- Version sync with the rest of my packages
- “Data.Stream.NonEmpty” renamed to “Data.List.NonEmpty” and pushed upstream into the semigroups package.
- Removed a redundant UNPACK pragma
- Data.Stream.Supply added
- A number of strictness issues with ‘NonEmpty’ were fixed
- More documentation