flix

0.78.0

Writable

trait Writable[t: Type]Source

Trait for types that can be written to.

Trait for types that can be written to, and its functions.

Associated Types

type Aef: EffSource

Effect associated with writing to the underlying resource.

type Elm: TypeSource

Type of each element that can be written to the resource.

Instances

instance Writable[EncodingWriter[t]] with Writable[t] where Writable.Elm[t] ~ Int8Source
type Elm = Chartype Aef = Aef[t]
instance Writable[StdIn]Source
type Elm = Int8type Aef = IO
instance Writable[StringBuilder[r]]Source
type Elm = Chartype Aef = r
instance Writable[TcpSocket]Source
type Elm = Int8type Aef = IO
instance Writable[java.io.OutputStream]Source
type Elm = Int8type Aef = IO

Signatures

def write(buffer: Array[Elm[t], r], writer: t): Result[IoError, Int32] \ r + Aef[t] with Writable[t]§ Source

Reads k items from b and writes them into the underlying resource.

Returns Ok(k) to signify that k items were successfully read and written to r.

Guarantees that 0 <= k <= length(b).

Returns Err(e) if some underlying I/O error occurs.

Module Definitions

def writeLine(line: String, writer: t): Result[IoError, Unit] \ IO + Aef[t] with Writable[t] where Writable.Elm[t] ~ Char§ Source

Writes line to writer and appends a new line separator.

The new line separator is platform dependent, and is determined by the "line.separator" system property.

def writeNewLine(writer: t): Result[IoError, Unit] \ IO + Aef[t] with Writable[t] where Writable.Elm[t] ~ Char§ Source

Writes a new line separator to writer.

The new line separator is platform dependent, and is determined by the "line.separator" system property.

def writeString(string: String, writer: t): Result[IoError, Unit] \ Aef[t] with Writable[t] where Writable.Elm[t] ~ Char§ Source

Writes string to writer.