-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Strict data types and String IO.
--   
--   This package provides strict versions of some standard Haskell data
--   types (pairs, Maybe and Either). It also contains strict IO
--   operations.
@package strict
@version 0.3.2


-- | The standard IO input functions using strict IO.
module System.IO.Strict

-- | Computation <a>hGetContents</a> <tt>hdl</tt> returns the list of
--   characters corresponding to the unread portion of the channel or file
--   managed by <tt>hdl</tt>, which is immediate closed.
--   
--   Items are read strictly from the input Handle.
--   
--   This operation may fail with:
--   
--   <ul>
--   <li><tt>isEOFError</tt> if the end of file has been reached.</li>
--   </ul>
hGetContents :: Handle -> IO String

-- | The <a>getContents</a> operation returns all user input as a single
--   string, which is read stirctly (same as <a>hGetContents</a>
--   <tt>stdin</tt>).
getContents :: IO String

-- | The <a>readFile</a> function reads a file and returns the contents of
--   the file as a string. The file is read strictly, as with
--   <a>getContents</a>.
readFile :: FilePath -> IO String

-- | The <a>interact</a> function takes a function of type
--   <tt>String-&gt;String</tt> as its argument. The entire input from the
--   standard input device is passed to this function as its argument, and
--   the resulting string is output on the standard output device.
interact :: (String -> String) -> IO ()


-- | Strict <tt>Either</tt>.
--   
--   Same as the standard Haskell <tt>Either</tt>, but <tt>Left _|_ = Right
--   _|_ = _|_</tt>
module Data.Strict.Either

-- | The strict choice type.
data Either a b
Left :: !a -> Either a b
Right :: !b -> Either a b

-- | Case analysis: if the value is <tt><a>Left</a> a</tt>, apply the first
--   function to <tt>a</tt>; if it is <tt><a>Right</a> b</tt>, apply the
--   second function to <tt>b</tt>.
either :: (a -> c) -> (b -> c) -> Either a b -> c

-- | Yields <a>True</a> iff the argument is of the form <tt>Left _</tt>.
isLeft :: Either a b -> Bool

-- | Yields <a>True</a> iff the argument is of the form <tt>Right _</tt>.
isRight :: Either a b -> Bool

-- | Extracts the element out of a <a>Left</a> and throws an error if the
--   argument is a <a>Right</a>.
fromLeft :: Either a b -> a

-- | Extracts the element out of a <a>Right</a> and throws an error if the
--   argument is a <a>Left</a>.
fromRight :: Either a b -> b
instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Data.Strict.Either.Either a b)
instance (GHC.Read.Read a, GHC.Read.Read b) => GHC.Read.Read (Data.Strict.Either.Either a b)
instance (GHC.Classes.Ord a, GHC.Classes.Ord b) => GHC.Classes.Ord (Data.Strict.Either.Either a b)
instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Data.Strict.Either.Either a b)
instance GHC.Base.Functor (Data.Strict.Either.Either a)


-- | Strict <tt>Maybe</tt>.
--   
--   Same as the standard Haskell <tt>Maybe</tt>, but <tt>Just _|_ =
--   _|_</tt>
--   
--   Note that strict <tt>Maybe</tt> is not a monad since <tt> return _|_
--   &gt;&gt;= f = _|_ </tt> which is not necessarily the same as <tt>f
--   _|_</tt>.
module Data.Strict.Maybe

-- | The type of strict optional values.
data Maybe a
Nothing :: Maybe a
Just :: !a -> Maybe a

-- | Yields <a>True</a> iff the argument is of the form <tt>Just _</tt>.
isJust :: Maybe a -> Bool

-- | Yields <a>True</a> iff the argument is <a>Nothing</a>.
isNothing :: Maybe a -> Bool

-- | Extracts the element out of a <a>Just</a> and throws an error if the
--   argument is <a>Nothing</a>.
fromJust :: Maybe a -> a

-- | Given a default value and a <a>Maybe</a>, yield the default value if
--   the <a>Maybe</a> argument is <a>Nothing</a> and extract the value out
--   of the <a>Just</a> otherwise.
fromMaybe :: a -> Maybe a -> a

-- | Given a default value, a function and a <a>Maybe</a> value, yields the
--   default value if the <a>Maybe</a> value is <a>Nothing</a> and applies
--   the function to the value stored in the <a>Just</a> otherwise.
maybe :: b -> (a -> b) -> Maybe a -> b
instance GHC.Read.Read a => GHC.Read.Read (Data.Strict.Maybe.Maybe a)
instance GHC.Show.Show a => GHC.Show.Show (Data.Strict.Maybe.Maybe a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Strict.Maybe.Maybe a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Strict.Maybe.Maybe a)
instance GHC.Base.Functor Data.Strict.Maybe.Maybe


-- | Strict pairs.
--   
--   Same as regular Haskell pairs, but <tt>(x :*: _|_) = (_|_ :*: y) =
--   _|_</tt>
module Data.Strict.Tuple

-- | The type of strict pairs.
data Pair a b
(:!:) :: !a -> !b -> Pair a b
type (:!:) = Pair

-- | Extract the first component of a strict pair.
fst :: Pair a b -> a

-- | Extract the second component of a strict pair.
snd :: Pair a b -> b

-- | Curry a function on strict pairs.
curry :: (Pair a b -> c) -> a -> b -> c

-- | Convert a curried function to a function on strict pairs.
uncurry :: (a -> b -> c) -> Pair a b -> c
instance (GHC.Arr.Ix a, GHC.Arr.Ix b) => GHC.Arr.Ix (Data.Strict.Tuple.Pair a b)
instance (GHC.Enum.Bounded a, GHC.Enum.Bounded b) => GHC.Enum.Bounded (Data.Strict.Tuple.Pair a b)
instance (GHC.Read.Read a, GHC.Read.Read b) => GHC.Read.Read (Data.Strict.Tuple.Pair a b)
instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Data.Strict.Tuple.Pair a b)
instance (GHC.Classes.Ord a, GHC.Classes.Ord b) => GHC.Classes.Ord (Data.Strict.Tuple.Pair a b)
instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (Data.Strict.Tuple.Pair a b)


-- | Strict versions of some standard Haskell types.
module Data.Strict
