fs-effectful
Safe HaskellNone
LanguageGHC2021

Effectful.FileSystem.HandleReader.Static

Description

Provides a static effect for reading a handle.

Since: 0.1

Synopsis

Effect

data HandleReader (a :: Type -> Type) b Source #

Static effect for reading a handle.

Since: 0.1

hIsEOF :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hIsEof.

Since: 0.1

hGetBuffering :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es BufferMode Source #

Lifted hGetBuffering.

Since: 0.1

hIsOpen :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hIsOpen.

Since: 0.1

hIsClosed :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hIsClosed.

Since: 0.1

hIsReadable :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hIsReadable.

Since: 0.1

hIsWritable :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hIsWritable.

Since: 0.1

hIsSeekable :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hIsSeekable.

Since: 0.1

hIsTerminalDevice :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hIsTerminalDevice.

Since: 0.1

hGetEcho :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hGetEcho.

Since: 0.1

hWaitForInput :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es Bool Source #

Lifted hWaitForInput.

Since: 0.1

hReady :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Bool Source #

Lifted hReady.

Since: 0.1

hGetChar :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es Char Source #

Lifted hGetChar.

Since: 0.1

hGetLine :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es ByteString Source #

Lifted hGetLine.

Since: 0.1

hGetContents :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Eff es ByteString Source #

Lifted hGetContents.

Since: 0.1

hGet :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es ByteString Source #

Lifted hGet.

Since: 0.1

hGetSome :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es ByteString Source #

Lifted hGetSome.

Since: 0.1

hGetNonBlocking :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es ByteString Source #

Lifted hGetNonBlocking.

Since: 0.1

Handlers

runHandleReader :: forall (es :: [Effect]) a. (HasCallStack, IOE :> es) => Eff (HandleReader ': es) a -> Eff es a Source #

Runs HandleReader in IO.

Since: 0.1

UTF-8 Utils

GetLine

GetContents

Get

hGetUtf8 :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es (Either UnicodeException Text) Source #

hGet and decodeUtf8.

Since: 0.1

hGetUtf8Lenient :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es Text Source #

hGet and decodeUtf8Lenient.

Since: 0.1

hGetUtf8ThrowM :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es Text Source #

hGet and decodeUtf8ThrowM.

Since: 0.1

GetSome

hGetSomeUtf8ThrowM :: forall (es :: [Effect]). (HandleReader :> es, HasCallStack) => Handle -> Int -> Eff es Text Source #

hGetSome and decodeUtf8ThrowM.

Since: 0.1

GetNonBlocking

Re-exports

data ByteString #

A space-efficient representation of a Word8 vector, supporting many efficient operations.

A ByteString contains 8-bit bytes, or by using the operations from Data.ByteString.Char8 it can be interpreted as containing 8-bit characters.

Instances

Instances details
NFData ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Methods

rnf :: ByteString -> () #

Monoid ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Semigroup ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Data ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteString -> c ByteString #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteString #

toConstr :: ByteString -> Constr #

dataTypeOf :: ByteString -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ByteString) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteString) #

gmapT :: (forall b. Data b => b -> b) -> ByteString -> ByteString #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteString -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteString -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

IsString ByteString #

Beware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�

Instance details

Defined in Data.ByteString.Internal.Type

IsList ByteString #

Since: bytestring-0.10.12.0

Instance details

Defined in Data.ByteString.Internal.Type

Associated Types

type Item ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Read ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Show ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Eq ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Ord ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

Lift ByteString #

Since: bytestring-0.11.2.0

Instance details

Defined in Data.ByteString.Internal.Type

Methods

lift :: Quote m => ByteString -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => ByteString -> Code m ByteString #

type Item ByteString # 
Instance details

Defined in Data.ByteString.Internal.Type

data Handle #

Haskell defines operations to read and write characters from and to files, represented by values of type Handle. Each value of this type is a handle: a record used by the Haskell run-time system to manage I/O with file system objects. A handle has at least the following properties:

  • whether it manages input or output or both;
  • whether it is open, closed or semi-closed;
  • whether the object is seekable;
  • whether buffering is disabled, or enabled on a line or block basis;
  • a buffer (whose length may be zero).

Most handles will also have a current I/O position indicating where the next input or output operation will occur. A handle is readable if it manages only input or both input and output; likewise, it is writable if it manages only output or both input and output. A handle is open when first allocated. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the Show and Eq classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to == only to itself; no attempt is made to compare the internal state of different handles for equality.

Instances

Instances details
Show Handle #

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Handle.Types

Eq Handle #

Since: base-4.1.0.0

Instance details

Defined in GHC.Internal.IO.Handle.Types

Methods

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

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

type OsPath = OsString #

Type representing filenames/pathnames.

This type doesn't add any guarantees over OsString.

data Text #

A space efficient, packed, unboxed Unicode text type.

Instances

Instances details
type Item Text # 
Instance details

Defined in Data.Text

type Item Text = Char