Journal article
Functional pearl: Streams and unique fixed points
- Abstract:
- Streams, infinite sequences of elements, live in a coworld: they are given by a coinductive data type, operations on streams are implemented by corecursive programs, and proofs are conducted using coinduction. But there is more to it: suitably restricted, stream equations possess unique solutions, a fact that is not very widely appreciated. We show that this property gives rise to a simple and attractive proof technique essentially bringing equational reasoning to the coworld. In fact, we redevelop the theory of recurrences, finite calculus and generating functions using streams and stream operators building on the cornerstone of unique solutions. The development is constructive: streams and stream operators are implemented in Haskell, usually by one-liners. The resulting calculus or library, if you wish, is elegant and fun to use. Finally, we rephrase the proof of uniqueness using generalised algebraic data types. Copyright © 2008 ACM.
Actions
Authors
- Journal:
- ACM SIGPLAN Notices More from this journal
- Volume:
- 43
- Issue:
- 9
- Pages:
- 189-200
- Publication date:
- 2008-09-01
- ISSN:
-
1523-2867
- Language:
-
English
- Keywords:
- Pubs id:
-
pubs:328660
- UUID:
-
uuid:5989fde2-afa7-422e-a961-f350c172f6eb
- Local pid:
-
pubs:328660
- Source identifiers:
-
328660
- Deposit date:
-
2012-12-19
Terms of use
- Copyright date:
- 2008
If you are the owner of this record, you can report an update to it here: Report update to this record