dialogue-0.1.0: I/O in Haskell Report 1.2
Copyright(c) Alias Qli 2022
LicenseBSD-3-Clause
Maintainer2576814881@qq.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.IO.Continuation

Description

This module implements continuation-based I/O as described in Haskell Report 1.2. It shares the same basic types as stream-based I/O.

Synopsis

Continuation Types

Transactions

Continuation-based IO is based on a collection of functions called transactions/ defined in a continuation style. Please refer to the corresponding constructors under Request for documentations.

Other Functions

print :: Show a => a -> Dialogue Source #

prints :: Show a => a -> String -> Dialogue Source #

Re-exports

Types

type Dialogue = [Response] -> [Request] Source #

Type of a Haskell program. [Response] is an ordered list of responses and [Request] is an ordered list of requests; the nth response is the operating system's reply to the nth request.

type Bin = ByteString Source #

Bin is a datatype for binary values, as required by the report, and is implemented as a lazy ByteString.

type Name = String Source #

This type synonym is described in Haskell Report 1.0, and exists for backward compatibility.

data IOError Source #

Constructors

WriteError String 
ReadError String 
SearchError String 
FormatError String

Since we're using a modern device and the maximum line length and page length allowed on the channel have no bound, this error would never occur.

OtherError String 

Instances

Instances details
Read IOError Source # 
Instance details

Defined in System.IO.Dialogue

Show IOError Source # 
Instance details

Defined in System.IO.Dialogue

Eq IOError Source # 
Instance details

Defined in System.IO.Dialogue

Methods

(==) :: IOError -> IOError -> Bool #

(/=) :: IOError -> IOError -> Bool #

Ord IOError Source # 
Instance details

Defined in System.IO.Dialogue

Channels

stdin :: Name Source #

The stdin channel. Readable.

stdout :: Name Source #

The stdout channel. Writable.

stderr :: Name Source #

The stderr channel. Writable.

stdecho :: Name Source #

The stdecho channel. Writable. Attached to stdout.

Run the Program

runDialogue :: Dialogue -> IO () Source #

The central function to run a program.