Hoogle Search

Within LTS Haskell 24.67 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. ReadState :: m a -> ReadState (m :: Type -> Type) a

    capability Capability.Reader

    No documentation available.

  2. newtype ReadStatePure (m :: Type -> Type) a

    capability Capability.Reader

    Convert a pure state monad into a reader monad. Pure meaning that the monad stack does not allow catching exceptions. Otherwise, an exception occurring in the action passed to local could cause the context to remain modified outside of the call to local. E.g.

    local @tag (const r') (throw MyException)
    `catch` \MyException -> ask @tag
    
    returns r' instead of the previous value. Note, that no MonadIO instance is provided, as this would allow catching exceptions. See ReadState.

  3. ReadStatePure :: m a -> ReadStatePure (m :: Type -> Type) a

    capability Capability.Reader

    No documentation available.

  4. newtype ReadState (m :: Type -> Type) a

    capability Capability.Source

    Convert a state monad into a reader monad. Use this if the monad stack allows catching exceptions. See ReadStatePure.

  5. ReadState :: m a -> ReadState (m :: Type -> Type) a

    capability Capability.Source

    No documentation available.

  6. newtype ReadStatePure (m :: Type -> Type) a

    capability Capability.Source

    Convert a pure state monad into a reader monad. Pure meaning that the monad stack does not allow catching exceptions. Otherwise, an exception occurring in the action passed to local could cause the context to remain modified outside of the call to local. E.g.

    local @tag (const r') (throw MyException)
    `catch` \MyException -> ask @tag
    
    returns r' instead of the previous value. Note, that no MonadIO instance is provided, as this would allow catching exceptions. See ReadState.

  7. ReadStatePure :: m a -> ReadStatePure (m :: Type -> Type) a

    capability Capability.Source

    No documentation available.

  8. newtype ReaderIORef (m :: k -> Type) (a :: k)

    capability Capability.Source

    Derive a state monad from a reader over an IORef. Example:

    newtype MyState m a = MyState (ReaderT (IORef Int) m a)
    deriving (Functor, Applicative, Monad)
    deriving HasState "foo" Int via
    ReaderIORef (MonadReader (ReaderT (IORef Int) m))
    
    See ReaderRef for a more generic strategy.

  9. ReaderIORef :: m a -> ReaderIORef (m :: k -> Type) (a :: k)

    capability Capability.Source

    No documentation available.

  10. newtype ReaderRef (m :: Type -> Type) a

    capability Capability.Source

    Derive a state monad from a reader over a mutable reference. Mutable references are available in a PrimMonad. The corresponding PrimState has to match the MCState of the reference. This constraint makes a stand-alone deriving clause necessary. Example:

    newtype MyState m a = MyState (ReaderT (IORef Int) m a)
    deriving (Functor, Applicative, Monad)
    deriving via ReaderRef (MonadReader (ReaderT (IORef Int) m))
    instance (PrimMonad m, PrimState m ~ PrimState IO)
    => HasState "foo" Int (MyState m)
    
    See ReaderIORef for a specialized version over IORef.

Page 412 of many | Previous | Next