Sinkable[T]
Abstract type for values that sinks can be obtained from, whose instances have
the methods below. An Array is Sinkable; a class that only
implements (sink) is not.
Implements: BaseSinkable[T]
Methods
prechomp[U @ (Str | Bin)]() -> Sink[U]
Returns a sink that removes one trailing line terminator from each value.
Parameters
| Name | Type | Description |
|---|---|---|
self |
Sinkable[U] |
Receiver. |
precrimp[U @ (Str | Bin)] … -> Sink[U]
Returns a sink that appends a line terminator to each value.
Parameters
| Name | Type | Description |
|---|---|---|
self |
Sinkable[U] |
Receiver. |
terminator? |
(Str | Bin) |
prefilter pred -> Sink[T]
Returns a sink that writes only values for which pred is truthy.
Parameters
| Name | Type | Description |
|---|---|---|
pred |
((T) -> Value) |
premap[U] func -> Sink[U]
Returns a sink that transforms each value with func before writing it.
Parameters
| Name | Type | Description |
|---|---|---|
func |
((U) -> T) |
put value
Writes a value to the sink.
Parameters
| Name | Type | Description |
|---|---|---|
value |
T |
sink() -> Sink[T]
Returns a sink over the value.