srfi-41
SRFI 41 for Chicken Scheme.
TOC »
- srfi-41
- Documentation
- Usage
- Primitive
- Derived
- Usage
- define-stream
- stream-of
- stream-let
- stream-match
- stream
- list->stream
- port->stream
- stream->list
- stream-append
- stream-concat
- stream-drop
- stream-drop-while
- stream-filter
- stream-fold
- stream-for-each
- stream-map
- stream-from
- stream-iterate
- stream-length
- stream-range
- stream-ref
- stream-reverse
- stream-scan
- stream-unfold
- stream-unfolds
- stream-zip
- Utilities
- Usage
- stream-intersperse
- stream-permutations
- file->stream
- stream-split
- stream-unique
- stream-fold-one
- stream-member
- stream-merge
- stream-partition
- stream-finds
- stream-find
- stream-remove
- stream-every
- stream-any
- stream-and
- stream-or
- stream-fold-right
- stream-fold-right-one
- stream-assoc
- stream-equal?
- stream-quick-sort
- stream-insertion-sort
- stream-merge-sort
- stream-maximum
- stream-minimum
- binary-tree-same-fringe?
- Math Utilities
- Examples
- Requirements
- Author
- Repository
- Version history
- License
Documentation
See the SRFI-41 Document.
Usage
The exports of streams-primitive and streams-derived are povided by:
(import srfi-41) ;Or (a synonym) (import streams)
Primitive
Usage
(import (streams primitive))
stream?
- stream? OBJECTprocedure
stream-pair?
- stream-pair? OBJECTprocedure
stream-null?
- stream-null? OBJECTprocedure
stream-occupied?
- stream-occupied? OBJECTprocedure
Inverse of stream-null?.
stream-null
- stream-nullconstant
The null stream value.
stream-cons
stream-lambda
stream-car
- stream-car STREAMprocedure
stream-cdr
- stream-cdr STREAMprocedure
Derived
Usage
(import (streams derived))
define-stream
stream-of
stream-let
stream-match
stream
list->stream
- list->stream LISTprocedure
port->stream
stream->list
stream-append
- stream-append STREAM...procedure
stream-concat
- stream-concat STREAMprocedure
Flatten a stream of streams.
stream-drop
- stream-drop COUNT STREAMprocedure
stream-drop-while
- stream-drop-while PREDICATE STREAMprocedure
stream-filter
- stream-filter PREDICATE STREAMprocedure
stream-fold
- stream-fold FUNCTION BASE STREAM...procedure
stream-for-each
- stream-for-each FUNCTION STREAM...procedure
stream-map
- stream-map FUNCTION STREAM...procedure
stream-from
stream-iterate
- stream-iterate FUNCTION BASEprocedure
stream-length
- stream-length STREAMprocedure
stream-range
stream-ref
- stream-ref STREAM INDEXprocedure
stream-reverse
- stream-reverse STREAMprocedure
stream-scan
- stream-scan FUNCTION BASE STREAMprocedure
stream-unfold
stream-unfolds
- stream-unfolds GENERATOR SEEDprocedure
stream-zip
- stream-zip STREAM...procedure
Utilities
Usage
(import (streams utils))
stream-intersperse
- stream-intersperse STREAM OBJECTprocedure
stream-permutations
- stream-permutations STREAMprocedure
file->stream
stream-split
- stream-split COUNT STREAMprocedure
stream-unique
- stream-unique =? STREAMprocedure
stream-fold-one
- stream-fold-one FUNCTION STREAMprocedure
stream-member
- stream-member =? OBJECT STREAMprocedure
stream-merge
- stream-merge <? STREAM ...procedure
stream-partition
- stream-partition PREDICATE STREAMprocedure
stream-finds
- stream-finds =? OBJECT STREAMprocedure
stream-find
- stream-find =? OBJECT STREAMprocedure
stream-remove
- stream-remove PREDICATE STREAMprocedure
stream-every
- stream-every PREDICATE STREAMprocedure
stream-any
- stream-any PREDICATE STREAMprocedure
stream-and
- stream-and STREAMprocedure
stream-or
- stream-or STREAMprocedure
stream-fold-right
stream-fold-right-one
stream-assoc
stream-equal?
- stream-equal? =? STREAM1 STREAM2procedure
stream-quick-sort
- stream-quick-sort <? STREAMprocedure
stream-insertion-sort
- stream-insertion-sort <? STREAMprocedure
stream-merge-sort
- stream-merge-sort <? STREAMprocedure
stream-maximum
- stream-maximum <? STREAMprocedure
stream-minimum
- stream-minimum <? STREAMprocedure
binary-tree-same-fringe?
- binary-tree-same-fringe? TREE1 TREE2procedure
TREE1 and TREE2 are binary-tree nodes, so either () or pair.
Lazy version of the same fringe.
Math Utilities
Usage
(import (streams math))
stream-max
- stream-max STREAMprocedure
stream-min
- stream-min STREAMprocedure
stream-sum
- stream-sumconstant
odd-numbers-stream
- odd-numbers-streamconstant
even-numbers-stream
- even-numbers-streamconstant
cardinal-numbers-stream
- cardinal-numbers-streamconstant
natural-numbers-stream
- natural-numbers-streamconstant
prime-numbers-stream
- prime-numbers-streamconstant
hamming-sequence-stream
- hamming-sequence-streamconstant
Examples
(import srfi-41) (define (sigma function m n) (stream-fold + 0 (stream-map function (stream-range m (add1 n))))) (define (factorial n) (stream-ref (stream-scan * 1 (stream-from 1)) n))
Requirements
Author
Philip L. Bewig
Repository
This egg is hosted on the CHICKEN Subversion repository:
https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/srfi-41
If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.
Version history
- 2.1.5
- Apply Chris Jester-Young's 2015 stream-constant speedup.
- 2.1.4
- Add multiple value result for stream-match.
- 2.1.3
- .
- 2.1.2
- .
- 2.1.1
- .
- 2.1.0
- Add (streams derived) style module naming.
- 2.0.4
- .
- 2.0.0
- CHICKEN 5 release.
License
Copyright (C) 2023 Kon Lovett. Copyright (C) 2007 by Philip L. Bewig of Saint Louis, Missouri, USA.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.