imperative-edsl-0.5: Deep embedding of imperative programs with code generation

Safe HaskellNone
LanguageHaskell2010

System.IO.Fake

Description

Running actions with explicit input/output connected to stdin/stdout.

This module is inspired by the package http://hackage.haskell.org/package/silently.

Synopsis

Documentation

withTempFile Source

Arguments

:: FilePath

Path to directory for temporary file

-> String

Base name for temporary file

-> ((FilePath, Handle) -> IO a)

Action

-> IO a 

Perform an action that with access to a temporary file. The file is removed after the action is completed.

withRedirect Source

Arguments

:: Handle

Shadowing handle

-> Handle

Shadowed handle

-> IO a

Action in which the redirect takes place

-> IO a 

Perform an action with a redirected handle

fakeIO Source

Arguments

:: IO a

Action

-> String

Input to send to stdin

-> IO String

Result from stdout

Perform an action with explicit input/output connected to stdin/stdout