|
Control.Concurrent.SCC.Primitives |
|
|
|
|
Description |
Module Primitives defines primitive components of Producer, Consumer, Transducer and Splitter types,
defined in the Types module.
|
|
Synopsis |
|
|
|
|
Tag types
|
|
|
Used by parseSubstring to distinguish between overlapping substrings.
| Instances | |
|
|
List producers and consumers
|
|
|
fromList produces the contents of the given list argument.
|
|
|
Consumer toList copies the given source into a list.
|
|
I/O producers and consumers
|
|
|
Producer fromFile opens the named file and feeds the given sink from its contents.
|
|
|
Producer fromHandle feeds the given sink from the open file handle. The argument doClose determines
| if handle should be closed when the handle is consumed or the sink closed.
|
|
|
Producer fromStdIn feeds the given sink from the standard input.
|
|
|
Consumer appendFile opens the name file and appends the given source to it.
|
|
|
Consumer toFile opens the named file and copies the given source into it.
|
|
|
Consumer toHandle copies the given source into the open file handle. The argument doClose determines
| if handle should be closed once the entire source is consumed and copied.
|
|
|
Consumer toStdOut copies the given source into the standard output.
|
|
Generic consumers
|
|
|
The suppress consumer suppresses all input it receives. It is equivalent to substitute []
|
|
|
The erroneous consumer reports an error if any input reaches it.
|
|
Generic transducers
|
|
|
Transducer asis passes its input through unmodified.
|
|
|
Transducer parse prepares input content for subsequent parsing.
|
|
|
Transducer unparse removes all markup from its input and passes the content through.
|
|
|
Performs the same task as the substring splitter, but instead of splitting it outputs the input as Markup x
OccurenceTag in order to distinguish overlapping strings.
|
|
Generic splitters
|
|
|
Splitter everything feeds its entire input into its true sink.
|
|
|
Splitter nothing feeds its entire input into its false sink.
|
|
|
Splitter marked passes all marked-up input sections to its true sink, and all unmarked input to its
false sink.
|
|
|
Splitter markedContent passes the content of all marked-up input sections to its true sink, while the
outermost tags and all unmarked input go to its false sink.
|
|
|
Splitter markedWith passes input sections marked-up with the appropriate tag to its true sink, and the
rest of the input to its false sink. The argument select determines if the tag is appropriate.
|
|
|
Splitter contentMarkedWith passes the content of input sections marked-up with the appropriate tag to
its true sink, and the rest of the input to its false sink. The argument select determines if the tag is
appropriate.
|
|
|
Splitter one feeds all input values to its true sink, treating every value as a separate section.
|
|
|
Splitter substring feeds to its true sink all input parts that match the contents of the given list
argument. If two overlapping parts of the input both match the argument, both are sent to true and each is preceded
by an edge.
|
|
List transducers
|
|
The following laws hold:
|
|
|
Transducer group collects all its input values into a single list.
|
|
|
Transducer concatenate flattens the input stream of lists of values into the output stream of values.
|
|
|
Same as concatenate except it inserts the given separator list between every two input lists.
|
|
Character stream components
|
|
|
The lowercase transforms all uppercase letters in the input to lowercase, leaving the rest unchanged.
|
|
|
The uppercase transforms all lowercase letters in the input to uppercase, leaving the rest unchanged.
|
|
|
Splitter whitespace feeds all white-space characters into its true sink, all others into false.
|
|
|
Splitter letters feeds all alphabetical characters into its true sink, all other characters into
| false.
|
|
|
Splitter digits feeds all digits into its true sink, all other characters into false.
|
|
|
The sectioning splitter line feeds line-ends into its false sink, and line contents into true. A single
line-end can be formed by any of the character sequences "\n", "\r", "\r\n", or "\n\r".
|
|
|
Splitter nonEmptyLine feeds line-ends into its false sink, and all other characters into true.
|
|
Oddballs
|
|
|
The count transducer counts all its input values and outputs the final tally.
|
|
|
Converts each input value x to show x.
|
|
Produced by Haddock version 2.6.0 |