Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mappedFileGetBytes :: (HasCallStack, MonadIO m) => MappedFile -> m Bytesgi-glib GI.GLib.Structs.MappedFile Creates a new Bytes which references the data mapped from file. The mapped contents of the file must not be modified after creating this bytes object, because a Bytes should be immutable. Since: 2.34
mappedFileGetContents :: (HasCallStack, MonadIO m) => MappedFile -> m Textgi-glib GI.GLib.Structs.MappedFile Returns the contents of a MappedFile. Note that the contents may not be zero-terminated, even if the MappedFile is backed by a text file. If the file is empty then Nothing is returned. Since: 2.8
mappedFileGetLength :: (HasCallStack, MonadIO m) => MappedFile -> m CSizegi-glib GI.GLib.Structs.MappedFile Returns the length of the contents of a MappedFile. Since: 2.8
mappedFileNew :: (HasCallStack, MonadIO m) => [Char] -> Bool -> m MappedFilegi-glib GI.GLib.Structs.MappedFile Maps a file into memory. On UNIX, this is using the mmap() function. If writable is True, the mapped buffer may be modified, otherwise it is an error to modify the mapped buffer. Modifications to the buffer are not visible to other processes mapping the same file, and are not written back to the file. Note that modifications of the underlying file might affect the contents of the MappedFile. Therefore, mapping should only be used if the file will not be modified, or if all modifications of the file are done atomically (e.g. using fileSetContents). If filename is the name of an empty, regular file, the function will successfully return an empty MappedFile. In other cases of size 0 (e.g. device files such as /dev/null), error will be set to the FileError value FileErrorInval. Since: 2.8
mappedFileNewFromFd :: (HasCallStack, MonadIO m) => Int32 -> Bool -> m MappedFilegi-glib GI.GLib.Structs.MappedFile Maps a file into memory. On UNIX, this is using the mmap() function. If writable is True, the mapped buffer may be modified, otherwise it is an error to modify the mapped buffer. Modifications to the buffer are not visible to other processes mapping the same file, and are not written back to the file. Note that modifications of the underlying file might affect the contents of the MappedFile. Therefore, mapping should only be used if the file will not be modified, or if all modifications of the file are done atomically (e.g. using fileSetContents). Since: 2.32
mappedFileRef :: (HasCallStack, MonadIO m) => MappedFile -> m MappedFilegi-glib GI.GLib.Structs.MappedFile Increments the reference count of file by one. It is safe to call this function from any thread. Since: 2.22
mappedFileUnref :: (HasCallStack, MonadIO m) => MappedFile -> m ()gi-glib GI.GLib.Structs.MappedFile Decrements the reference count of file by one. If the reference count drops to 0, unmaps the buffer of file and frees it. It is safe to call this function from any thread. Since 2.22
mapMatrixWithIndex :: (Element a, Storable b) => ((Int, Int) -> a -> b) -> Matrix a -> Matrix bhmatrix Numeric.LinearAlgebra.Devel >>> mapMatrixWithIndex (\(i,j) v -> 100*v + 10*fromIntegral i + fromIntegral j) (ident 3:: Matrix Double) (3><3) [ 100.0, 1.0, 2.0 , 10.0, 111.0, 12.0 , 20.0, 21.0, 122.0 ]
-
hmatrix Numeric.LinearAlgebra.Devel >>> mapMatrixWithIndexM (\(i,j) v -> Just $ 100*v + 10*fromIntegral i + fromIntegral j) (ident 3:: Matrix Double) Just (3><3) [ 100.0, 1.0, 2.0 , 10.0, 111.0, 12.0 , 20.0, 21.0, 122.0 ]
mapMatrixWithIndexM_ :: (Element a, Num a, Monad m) => ((Int, Int) -> a -> m ()) -> Matrix a -> m ()hmatrix Numeric.LinearAlgebra.Devel >>> mapMatrixWithIndexM_ (\(i,j) v -> printf "m[%d,%d] = %.f\n" i j v :: IO()) ((2><3)[1 :: Double ..]) m[0,0] = 1 m[0,1] = 2 m[0,2] = 3 m[1,0] = 4 m[1,1] = 5 m[1,2] = 6