HSH-2.1.2: Library to mix shell scripting with Haskell programs

Copyright | Copyright (C) 2006-2009 John Goerzen
License | GNU LGPL, version 2.1 or above
Maintainer | John Goerzen <jgoerzen@complete.org>
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell98

HSH.Channel

Description

Copyright (c) 2006-2009 John Goerzen, jgoerzen@complete.org

Synopsis

- data Channel
  - = ChanString String
  - | ChanBSL ByteString
  - | ChanHandle Handle
- chanAsString :: Channel -> IO String
- chanAsBSL :: Channel -> IO ByteString
- chanAsBS :: Channel -> IO ByteString
- chanToHandle :: Bool -> Channel -> Handle -> IO ()
- class Channelizable a where
  - toChannel :: a -> Channel

# Documentation

data Channel Source

The main type for communicating between commands. All are expected to be lazy.

Constructors

ChanString String |
ChanBSL ByteString |
ChanHandle Handle |

Instances

ShellCommand (Channel -> IO Channel) Source |

chanAsString :: Channel -> IO String Source

chanAsBSL :: Channel -> IO ByteString Source

chanAsBS :: Channel -> IO ByteString Source

chanToHandle :: Bool -> Channel -> Handle -> IO () Source

Writes the Channel to the given Handle. If the first parameter is True, do this in a separate thread and close the handle afterwards.

class Channelizable a where Source

Methods

toChannel :: a -> Channel Source

Instances

Channelizable String Source |
Channelizable Handle Source |
Channelizable ByteString Source |
Channelizable ByteString Source |