hbro-1.3.0.0: Minimal extensible web-browser

Safe HaskellNone
LanguageHaskell98

Hbro.Prelude

Contents

Description

Replacement for the traditional Prelude module. This module doesn't import any other Hbro.* module, so it can be safely imported from anywhere in the project.

Synopsis

Typeclass

class Describable a where

Like Show, for Text

Methods

describe :: a -> Text

Instances

Describable () 
Describable Config 
Describable KeyVal

Single characters are returned as is. For other keys, the corresponding keyName wrapped into <> is returned.

Describable KeyStroke 
Describable Modifier 
Describable ResourceAction 
Event e => Describable (Signal e) 
Describable (Modifier, KeyVal) 

type BaseIO m = (MonadBase IO m, MonadIO m)

Mix of MonadBase IO and MonadIO

type ControlIO m = (MonadBaseControl IO m, MonadIO m)

Mix of MonadBaseControl IO and MonadIO

Generic aliases/shortcuts

(|:) :: [a] -> a -> NonEmpty a

Build a NonEmpty from the right

(>:) :: a -> b -> (a, b) infix 0

Infix equivalent for (,)

io :: MonadIO m => IO a -> m a

Alias for liftIO

(>/>) :: MonadIO m => IO FilePath -> FilePath -> m FilePath

Like '(</>)' with first argument in IO to build platform-dependent paths.

abort :: MonadPlus m => m a

Alias for mzero

doNothing :: Monad m => m ()

Alias for return ()

File manipulation

readFileE :: (ControlIO m, MonadError Text m) => FilePath -> m ByteString

Lifted version of readFile

readFileE' :: (ControlIO m, MonadError Text m) => FilePath -> m ByteString

Strict version of readFileE

writeFileE :: (ControlIO m, MonadError Text m) => FilePath -> ByteString -> m ()

Lifted version of writeFile

writeFileE' :: (ControlIO m, MonadError Text m) => FilePath -> ByteString -> m ()

Strict version of writeFileE

Lens util

withM :: Profunctor p => Over p (WrappedMonad m) s t a b -> p a (m b) -> s -> m t

Alias for mapMOf

withM_ :: Monad m => Over (->) (WrappedMonad m) s t a a -> (a -> m ()) -> s -> m t

fwd :: Monad m => (a -> m ()) -> a -> m a