{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK not-home #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.IO.IOMode
-- Copyright   :  (c) The University of Glasgow, 1994-2008
-- License     :  see libraries/base/LICENSE
-- 
-- Maintainer  :  libraries@haskell.org
-- Stability   :  internal
-- Portability :  non-portable
--
-- The IOMode type
--
-----------------------------------------------------------------------------

module GHC.IO.IOMode (IOMode(..)) where

import GHC.Base
import GHC.Show
import GHC.Read
import GHC.Arr
import GHC.Enum

-- | See 'System.IO.openFile'
data IOMode      =  ReadMode | WriteMode | AppendMode | ReadWriteMode
                    deriving ( IOMode -> IOMode -> Bool
(IOMode -> IOMode -> Bool)
-> (IOMode -> IOMode -> Bool) -> Eq IOMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IOMode -> IOMode -> Bool
== :: IOMode -> IOMode -> Bool
$c/= :: IOMode -> IOMode -> Bool
/= :: IOMode -> IOMode -> Bool
Eq   -- ^ @since 4.2.0.0
                             , Eq IOMode
Eq IOMode
-> (IOMode -> IOMode -> Ordering)
-> (IOMode -> IOMode -> Bool)
-> (IOMode -> IOMode -> Bool)
-> (IOMode -> IOMode -> Bool)
-> (IOMode -> IOMode -> Bool)
-> (IOMode -> IOMode -> IOMode)
-> (IOMode -> IOMode -> IOMode)
-> Ord IOMode
IOMode -> IOMode -> Bool
IOMode -> IOMode -> Ordering
IOMode -> IOMode -> IOMode
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: IOMode -> IOMode -> Ordering
compare :: IOMode -> IOMode -> Ordering
$c< :: IOMode -> IOMode -> Bool
< :: IOMode -> IOMode -> Bool
$c<= :: IOMode -> IOMode -> Bool
<= :: IOMode -> IOMode -> Bool
$c> :: IOMode -> IOMode -> Bool
> :: IOMode -> IOMode -> Bool
$c>= :: IOMode -> IOMode -> Bool
>= :: IOMode -> IOMode -> Bool
$cmax :: IOMode -> IOMode -> IOMode
max :: IOMode -> IOMode -> IOMode
$cmin :: IOMode -> IOMode -> IOMode
min :: IOMode -> IOMode -> IOMode
Ord  -- ^ @since 4.2.0.0
                             , Ord IOMode
Ord IOMode
-> ((IOMode, IOMode) -> [IOMode])
-> ((IOMode, IOMode) -> IOMode -> Int)
-> ((IOMode, IOMode) -> IOMode -> Int)
-> ((IOMode, IOMode) -> IOMode -> Bool)
-> ((IOMode, IOMode) -> Int)
-> ((IOMode, IOMode) -> Int)
-> Ix IOMode
(IOMode, IOMode) -> Int
(IOMode, IOMode) -> [IOMode]
(IOMode, IOMode) -> IOMode -> Bool
(IOMode, IOMode) -> IOMode -> Int
forall a.
Ord a
-> ((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
$crange :: (IOMode, IOMode) -> [IOMode]
range :: (IOMode, IOMode) -> [IOMode]
$cindex :: (IOMode, IOMode) -> IOMode -> Int
index :: (IOMode, IOMode) -> IOMode -> Int
$cunsafeIndex :: (IOMode, IOMode) -> IOMode -> Int
unsafeIndex :: (IOMode, IOMode) -> IOMode -> Int
$cinRange :: (IOMode, IOMode) -> IOMode -> Bool
inRange :: (IOMode, IOMode) -> IOMode -> Bool
$crangeSize :: (IOMode, IOMode) -> Int
rangeSize :: (IOMode, IOMode) -> Int
$cunsafeRangeSize :: (IOMode, IOMode) -> Int
unsafeRangeSize :: (IOMode, IOMode) -> Int
Ix   -- ^ @since 4.2.0.0
                             , Int -> IOMode
IOMode -> Int
IOMode -> [IOMode]
IOMode -> IOMode
IOMode -> IOMode -> [IOMode]
IOMode -> IOMode -> IOMode -> [IOMode]
(IOMode -> IOMode)
-> (IOMode -> IOMode)
-> (Int -> IOMode)
-> (IOMode -> Int)
-> (IOMode -> [IOMode])
-> (IOMode -> IOMode -> [IOMode])
-> (IOMode -> IOMode -> [IOMode])
-> (IOMode -> IOMode -> IOMode -> [IOMode])
-> Enum IOMode
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: IOMode -> IOMode
succ :: IOMode -> IOMode
$cpred :: IOMode -> IOMode
pred :: IOMode -> IOMode
$ctoEnum :: Int -> IOMode
toEnum :: Int -> IOMode
$cfromEnum :: IOMode -> Int
fromEnum :: IOMode -> Int
$cenumFrom :: IOMode -> [IOMode]
enumFrom :: IOMode -> [IOMode]
$cenumFromThen :: IOMode -> IOMode -> [IOMode]
enumFromThen :: IOMode -> IOMode -> [IOMode]
$cenumFromTo :: IOMode -> IOMode -> [IOMode]
enumFromTo :: IOMode -> IOMode -> [IOMode]
$cenumFromThenTo :: IOMode -> IOMode -> IOMode -> [IOMode]
enumFromThenTo :: IOMode -> IOMode -> IOMode -> [IOMode]
Enum -- ^ @since 4.2.0.0
                             , ReadPrec [IOMode]
ReadPrec IOMode
Int -> ReadS IOMode
ReadS [IOMode]
(Int -> ReadS IOMode)
-> ReadS [IOMode]
-> ReadPrec IOMode
-> ReadPrec [IOMode]
-> Read IOMode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS IOMode
readsPrec :: Int -> ReadS IOMode
$creadList :: ReadS [IOMode]
readList :: ReadS [IOMode]
$creadPrec :: ReadPrec IOMode
readPrec :: ReadPrec IOMode
$creadListPrec :: ReadPrec [IOMode]
readListPrec :: ReadPrec [IOMode]
Read -- ^ @since 4.2.0.0
                             , Int -> IOMode -> ShowS
[IOMode] -> ShowS
IOMode -> String
(Int -> IOMode -> ShowS)
-> (IOMode -> String) -> ([IOMode] -> ShowS) -> Show IOMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IOMode -> ShowS
showsPrec :: Int -> IOMode -> ShowS
$cshow :: IOMode -> String
show :: IOMode -> String
$cshowList :: [IOMode] -> ShowS
showList :: [IOMode] -> ShowS
Show -- ^ @since 4.2.0.0
                             )