Hoogle Search
Within LTS Haskell 24.33 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
storablevector Data.StorableVector.Lazy No documentation available.
-
storablevector Data.StorableVector.Lazy.Pattern No documentation available.
-
storablevector Data.StorableVector.Lazy.Pattern No documentation available.
-
storablevector Data.StorableVector.Lazy.Typed No documentation available.
-
storablevector Data.StorableVector.Lazy.Typed No documentation available.
mapST :: (Storable a, Storable b) => (a -> ST s b) -> Vector a -> ST s (Vector b)storablevector Data.StorableVector.ST.Lazy :module + Data.STRef VS.unpack $ Control.Monad.ST.runST (do ref <- newSTRef 'a'; mapST (\ _n -> do c <- readSTRef ref; modifySTRef ref succ; return c) (VS.pack [1,2,3,4::Data.Int.Int16]))
mapSTLazy :: (Storable a, Storable b) => (a -> ST s b) -> Vector a -> ST s (Vector b)storablevector Data.StorableVector.ST.Lazy *Data.StorableVector.ST.Strict Data.STRef> VL.unpack $ Control.Monad.ST.runST (do ref <- newSTRef 'a'; mapSTLazy (\ _n -> do c <- readSTRef ref; modifySTRef ref succ; return c) (VL.pack VL.defaultChunkSize [1,2,3,4::Data.Int.Int16])) "abcd"
The following should not work on infinite streams, since we are in ST with strict >>=. But it works. Why?*Data.StorableVector.ST.Strict Data.STRef.Lazy> VL.unpack $ Control.Monad.ST.Lazy.runST (do ref <- newSTRef 'a'; mapSTLazy (\ _n -> do c <- readSTRef ref; modifySTRef ref succ; return c) (VL.pack VL.defaultChunkSize [0::Data.Int.Int16 ..])) "Interrupted.
mapST :: (Storable a, Storable b) => (a -> ST s b) -> Vector a -> ST s (Vector b)storablevector Data.StorableVector.ST.Strict :module + Data.STRef VS.unpack $ Control.Monad.ST.runST (do ref <- newSTRef 'a'; mapST (\ _n -> do c <- readSTRef ref; modifySTRef ref succ; return c) (VS.pack [1,2,3,4::Data.Int.Int16]))
mapSTLazy :: (Storable a, Storable b) => (a -> ST s b) -> Vector a -> ST s (Vector b)storablevector Data.StorableVector.ST.Strict *Data.StorableVector.ST.Strict Data.STRef> VL.unpack $ Control.Monad.ST.runST (do ref <- newSTRef 'a'; mapSTLazy (\ _n -> do c <- readSTRef ref; modifySTRef ref succ; return c) (VL.pack VL.defaultChunkSize [1,2,3,4::Data.Int.Int16])) "abcd"
The following should not work on infinite streams, since we are in ST with strict >>=. But it works. Why?*Data.StorableVector.ST.Strict Data.STRef> VL.unpack $ Control.Monad.ST.runST (do ref <- newSTRef 'a'; mapSTLazy (\ _n -> do c <- readSTRef ref; modifySTRef ref succ; return c) (VL.pack VL.defaultChunkSize [0::Data.Int.Int16 ..])) "Interrupted.
mapLoc :: SameSpace a b => (a -> b) -> Located a -> Located bdiagrams-lib Diagrams.Located Located is not a Functor, since changing the type could change the type of the associated vector space, in which case the associated location would no longer have the right type. mapLoc has an extra constraint specifying that the vector space must stay the same. (Technically, one can say that for every vector space v, Located is a little-f (endo)functor on the category of types with associated vector space v; but that is not covered by the standard Functor class.)