streamly icon indicating copy to clipboard operation
streamly copied to clipboard

Add APIs to generate streams from a memory address

Open harendra-kumar opened this issue 3 years ago • 0 comments

We are removing these APIs from the Array module (PR #1718), however, we can have stream equivalent of these as follows:

fromAddrN# :: Int -> Addr# -> Stream m a
fromPtrN :: Int -> Ptr a -> Stream m a

-- In Streamly.Unicode
fromUtf8# :: Addr# -> Stream m Char -- terminate on encountering Null byte

These will be useful to generate streams directly from string literals without going through lists.

harendra-kumar avatar Jul 21 '22 12:07 harendra-kumar