Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Res a = Res !Int !a
- newtype PushT v p m a = PushT (forall s. Int -> STRef s (v s p) -> STT s m (Res a))
- liftST :: Applicative m => ST s a -> STT s m a
- runPushT :: (Monad m, Vector v p) => PushT (Mutable v) p m a -> m (a, v p)
- runPushTU :: forall p a m. (Unbox p, Monad m) => PushT MVector p m a -> m (a, Vector p)
- runPushTB :: forall p a m. Monad m => PushT MVector p m a -> m (a, Vector p)
- runPushTS :: forall p a m. (Storable p, Monad m) => PushT MVector p m a -> m (a, Vector p)
Documentation
The internal return type of a push action. The Int value is the new vector used length.
newtype PushT v p m a Source #
A monad transformer that lets you push things onto a stack. This is probably super unsafe; see the docs for Control.Monad.ST.Trans.
liftST :: Applicative m => ST s a -> STT s m a Source #
This seems *highly* questionable, but appears to get the job done.
runPushT :: (Monad m, Vector v p) => PushT (Mutable v) p m a -> m (a, v p) Source #
Run the monad transformer.
runPushTU :: forall p a m. (Unbox p, Monad m) => PushT MVector p m a -> m (a, Vector p) Source #
Specialized to Unboxed vectors.