Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- (>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
- (<|>) :: Alternative f => f a -> f a -> f a
- (<>) :: Semigroup a => a -> a -> a
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- (&) :: a -> (a -> b) -> b
- module Control.Error
- module Control.Monad.Except
- module Control.Monad.Trans.Class
- module Control.Monad.IO.Class
- module Data.Bifunctor
- module System.Process.Typed
- module Polysemy
- lowerError :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Typeable e, Member (Embed IO) r) => (forall x. Sem r x -> IO x) -> Sem ((Error e :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r (Either e a)
- errorToIOFinal :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Typeable e, Member (Final IO) r) => Sem ((Error e :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r (Either e a)
- mapError :: forall e1 e2 (r :: [(Type -> Type) -> Type -> Type]) a. Member (Error e2 :: (Type -> Type) -> Type -> Type) r => (e1 -> e2) -> Sem ((Error e1 :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a
- runError :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. Sem ((Error e :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r (Either e a)
- catchJust :: forall e (r :: [(Type -> Type) -> Type -> Type]) b a. Member (Error e :: (Type -> Type) -> Type -> Type) r => (e -> Maybe b) -> Sem r a -> (b -> Sem r a) -> Sem r a
- fromExceptionSemVia :: forall exc err (r :: [(Type -> Type) -> Type -> Type]) a. (Exception exc, Member (Error err :: (Type -> Type) -> Type -> Type) r, Member (Final IO) r) => (exc -> err) -> Sem r a -> Sem r a
- fromExceptionSem :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Exception e, Member (Error e :: (Type -> Type) -> Type -> Type) r, Member (Final IO) r) => Sem r a -> Sem r a
- fromExceptionVia :: forall exc err (r :: [(Type -> Type) -> Type -> Type]) a. (Exception exc, Member (Error err :: (Type -> Type) -> Type -> Type) r, Member (Embed IO) r) => (exc -> err) -> IO a -> Sem r a
- fromException :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Exception e, Member (Error e :: (Type -> Type) -> Type -> Type) r, Member (Embed IO) r) => IO a -> Sem r a
- fromEitherM :: forall e m (r :: [(Type -> Type) -> Type -> Type]) a. (Member (Error e :: (Type -> Type) -> Type -> Type) r, Member (Embed m) r) => m (Either e a) -> Sem r a
- fromEither :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. Member (Error e :: (Type -> Type) -> Type -> Type) r => Either e a -> Sem r a
- catch :: forall e (r :: [Effect]) a. MemberWithError (Error e :: (Type -> Type) -> Type -> Type) r => Sem r a -> (e -> Sem r a) -> Sem r a
- throw :: forall e (r :: [Effect]) a. MemberWithError (Error e :: (Type -> Type) -> Type -> Type) r => e -> Sem r a
- data Error e (m :: k -> Type) (a :: k) where
- data Set a
- data Text
- data Vector a
- interpolate :: QuasiQuoter
- tshow :: Show a => a -> Text
- tryIOTextET :: MonadIO m => IO a -> ExceptT Text m a
- whenM :: Monad m => m Bool -> m () -> m ()
- ourReadProcess_ :: MonadIO m => ProcessConfig stdin stdout stderr -> ExceptT Text m (Text, Text)
- ourReadProcess_Sem :: Members '[Process] r => ProcessConfig stdin stdoutIgnored stderrIgnored -> Sem r (Text, Text)
- ourReadProcessInterleaved_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> ExceptT Text m Text
- ourReadProcessInterleavedBS_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> ExceptT Text m ByteString
- ourReadProcessInterleaved :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> ExceptT Text m (ExitCode, Text)
- ourReadProcessInterleaved_Sem :: Members '[Process] r => ProcessConfig stdin stdoutIgnored stderrIgnored -> Sem r Text
- ourReadProcessInterleavedSem :: Members '[Process] r => ProcessConfig stdin stdoutIgnored stderrIgnored -> Sem r (ExitCode, Text)
- silently :: ProcessConfig stdin stdout stderr -> ProcessConfig () () ()
- bytestringToText :: ByteString -> Text
Documentation
(>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c infixr 1 #
Left-to-right composition
(<|>) :: Alternative f => f a -> f a -> f a infixl 3 #
An associative binary operation
(<>) :: Semigroup a => a -> a -> a infixr 6 #
An associative operation.
>>>
[1,2,3] <> [4,5,6]
[1,2,3,4,5,6]
module Control.Error
module Control.Monad.Except
module Control.Monad.Trans.Class
module Control.Monad.IO.Class
module Data.Bifunctor
module System.Process.Typed
module Polysemy
:: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Typeable e, Member (Embed IO) r) | |
=> (forall x. Sem r x -> IO x) | Strategy for lowering a |
-> Sem ((Error e :: (Type -> Type) -> Type -> Type) ': r) a | |
-> Sem r (Either e a) |
errorToIOFinal :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Typeable e, Member (Final IO) r) => Sem ((Error e :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r (Either e a) #
mapError :: forall e1 e2 (r :: [(Type -> Type) -> Type -> Type]) a. Member (Error e2 :: (Type -> Type) -> Type -> Type) r => (e1 -> e2) -> Sem ((Error e1 :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r a #
Transform one Error
into another. This function can be used to aggregate
multiple errors into a single type.
Since: polysemy-1.0.0.0
runError :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. Sem ((Error e :: (Type -> Type) -> Type -> Type) ': r) a -> Sem r (Either e a) #
fromExceptionSemVia :: forall exc err (r :: [(Type -> Type) -> Type -> Type]) a. (Exception exc, Member (Error err :: (Type -> Type) -> Type -> Type) r, Member (Final IO) r) => (exc -> err) -> Sem r a -> Sem r a #
Like fromExceptionSem
, but with the ability to transform the exception
before turning it into an Error
.
fromExceptionSem :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Exception e, Member (Error e :: (Type -> Type) -> Type -> Type) r, Member (Final IO) r) => Sem r a -> Sem r a #
fromExceptionVia :: forall exc err (r :: [(Type -> Type) -> Type -> Type]) a. (Exception exc, Member (Error err :: (Type -> Type) -> Type -> Type) r, Member (Embed IO) r) => (exc -> err) -> IO a -> Sem r a #
Like fromException
, but with the ability to transform the exception
before turning it into an Error
.
fromException :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. (Exception e, Member (Error e :: (Type -> Type) -> Type -> Type) r, Member (Embed IO) r) => IO a -> Sem r a #
fromEitherM :: forall e m (r :: [(Type -> Type) -> Type -> Type]) a. (Member (Error e :: (Type -> Type) -> Type -> Type) r, Member (Embed m) r) => m (Either e a) -> Sem r a #
A combinator doing embed
and fromEither
at the same time. Useful for
interoperating with IO
.
Since: polysemy-0.5.1.0
fromEither :: forall e (r :: [(Type -> Type) -> Type -> Type]) a. Member (Error e :: (Type -> Type) -> Type -> Type) r => Either e a -> Sem r a #
catch :: forall e (r :: [Effect]) a. MemberWithError (Error e :: (Type -> Type) -> Type -> Type) r => Sem r a -> (e -> Sem r a) -> Sem r a #
throw :: forall e (r :: [Effect]) a. MemberWithError (Error e :: (Type -> Type) -> Type -> Type) r => e -> Sem r a #
data Error e (m :: k -> Type) (a :: k) where #
Throw :: forall k e (m :: k -> Type) (a :: k). e -> Error e m a | |
Catch :: forall k e (m :: k -> Type) (a :: k). m a -> (e -> m a) -> Error e m a |
Instances
type DefiningModule (Error :: Type -> (k -> Type) -> k -> Type) | |
Defined in Polysemy.Error |
A set of values a
.
Instances
Foldable Set | Folds in order of increasing key. |
Defined in Data.Set.Internal fold :: Monoid m => Set m -> m # foldMap :: Monoid m => (a -> m) -> Set a -> m # foldMap' :: Monoid m => (a -> m) -> Set a -> m # foldr :: (a -> b -> b) -> b -> Set a -> b # foldr' :: (a -> b -> b) -> b -> Set a -> b # foldl :: (b -> a -> b) -> b -> Set a -> b # foldl' :: (b -> a -> b) -> b -> Set a -> b # foldr1 :: (a -> a -> a) -> Set a -> a # foldl1 :: (a -> a -> a) -> Set a -> a # elem :: Eq a => a -> Set a -> Bool # maximum :: Ord a => Set a -> a # | |
ToJSON1 Set | |
Defined in Data.Aeson.Types.ToJSON | |
Eq1 Set | Since: containers-0.5.9 |
Ord1 Set | Since: containers-0.5.9 |
Defined in Data.Set.Internal | |
Show1 Set | Since: containers-0.5.9 |
Ord a => IsList (Set a) | Since: containers-0.5.6.2 |
Eq a => Eq (Set a) | |
(Data a, Ord a) => Data (Set a) | |
Defined in Data.Set.Internal gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Set a -> c (Set a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Set a) # dataTypeOf :: Set a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Set a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Set a)) # gmapT :: (forall b. Data b => b -> b) -> Set a -> Set a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Set a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Set a -> r # gmapQ :: (forall d. Data d => d -> u) -> Set a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Set a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Set a -> m (Set a) # | |
Ord a => Ord (Set a) | |
(Read a, Ord a) => Read (Set a) | |
Show a => Show (Set a) | |
Ord a => Semigroup (Set a) | Since: containers-0.5.7 |
Ord a => Monoid (Set a) | |
ToJSON a => ToJSON (Set a) | |
Defined in Data.Aeson.Types.ToJSON | |
(Ord a, FromJSON a) => FromJSON (Set a) | |
NFData a => NFData (Set a) | |
Defined in Data.Set.Internal | |
Ord a => PartialOrd (Set a) | Define the partial order in terms of the subset relation. |
type Item (Set a) | |
Defined in Data.Set.Internal |
A space efficient, packed, unboxed Unicode text type.
Instances
Boxed vectors, supporting efficient slicing.
Instances
Monad Vector | |
Functor Vector | |
MonadFix Vector | Instance has same semantics as one for lists Since: vector-0.12.2.0 |
Defined in Data.Vector | |
MonadFail Vector | Since: vector-0.12.1.0 |
Defined in Data.Vector | |
Applicative Vector | |
Foldable Vector | |
Defined in Data.Vector fold :: Monoid m => Vector m -> m # foldMap :: Monoid m => (a -> m) -> Vector a -> m # foldMap' :: Monoid m => (a -> m) -> Vector a -> m # foldr :: (a -> b -> b) -> b -> Vector a -> b # foldr' :: (a -> b -> b) -> b -> Vector a -> b # foldl :: (b -> a -> b) -> b -> Vector a -> b # foldl' :: (b -> a -> b) -> b -> Vector a -> b # foldr1 :: (a -> a -> a) -> Vector a -> a # foldl1 :: (a -> a -> a) -> Vector a -> a # elem :: Eq a => a -> Vector a -> Bool # maximum :: Ord a => Vector a -> a # minimum :: Ord a => Vector a -> a # | |
Traversable Vector | |
ToJSON1 Vector | |
Defined in Data.Aeson.Types.ToJSON liftToJSON :: (a -> Value) -> ([a] -> Value) -> Vector a -> Value # liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Vector a] -> Value # liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Vector a -> Encoding # liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Vector a] -> Encoding # | |
FromJSON1 Vector | |
Alternative Vector | |
MonadPlus Vector | |
Eq1 Vector | |
Ord1 Vector | |
Defined in Data.Vector | |
Read1 Vector | |
Defined in Data.Vector | |
Show1 Vector | |
MonadZip Vector | |
NFData1 Vector | Since: vector-0.12.1.0 |
Defined in Data.Vector | |
Vector Vector a | |
Defined in Data.Vector basicUnsafeFreeze :: PrimMonad m => Mutable Vector (PrimState m) a -> m (Vector a) # basicUnsafeThaw :: PrimMonad m => Vector a -> m (Mutable Vector (PrimState m) a) # basicLength :: Vector a -> Int # basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a # basicUnsafeIndexM :: Monad m => Vector a -> Int -> m a # basicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) a -> Vector a -> m () # | |
IsList (Vector a) | |
Eq a => Eq (Vector a) | |
Data a => Data (Vector a) | |
Defined in Data.Vector gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vector a -> c (Vector a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector a) # toConstr :: Vector a -> Constr # dataTypeOf :: Vector a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vector a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector a)) # gmapT :: (forall b. Data b => b -> b) -> Vector a -> Vector a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector a -> r # gmapQ :: (forall d. Data d => d -> u) -> Vector a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector a -> m (Vector a) # | |
Ord a => Ord (Vector a) | |
Defined in Data.Vector | |
Read a => Read (Vector a) | |
Show a => Show (Vector a) | |
Semigroup (Vector a) | |
Monoid (Vector a) | |
ToJSON a => ToJSON (Vector a) | |
Defined in Data.Aeson.Types.ToJSON | |
FromJSON a => FromJSON (Vector a) | |
NFData a => NFData (Vector a) | |
Defined in Data.Vector | |
type Key Vector | |
Defined in Data.Vector.Instances | |
type Mutable Vector | |
Defined in Data.Vector | |
type Item (Vector a) | |
Defined in Data.Vector |
ourReadProcess_ :: MonadIO m => ProcessConfig stdin stdout stderr -> ExceptT Text m (Text, Text) Source #
ourReadProcess_Sem :: Members '[Process] r => ProcessConfig stdin stdoutIgnored stderrIgnored -> Sem r (Text, Text) Source #
ourReadProcessInterleaved_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> ExceptT Text m Text Source #
ourReadProcessInterleavedBS_ :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> ExceptT Text m ByteString Source #
ourReadProcessInterleaved :: MonadIO m => ProcessConfig stdin stdoutIgnored stderrIgnored -> ExceptT Text m (ExitCode, Text) Source #
ourReadProcessInterleaved_Sem :: Members '[Process] r => ProcessConfig stdin stdoutIgnored stderrIgnored -> Sem r Text Source #
ourReadProcessInterleavedSem :: Members '[Process] r => ProcessConfig stdin stdoutIgnored stderrIgnored -> Sem r (ExitCode, Text) Source #
silently :: ProcessConfig stdin stdout stderr -> ProcessConfig () () () Source #
bytestringToText :: ByteString -> Text Source #