-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify Array APIs #2391
Unify Array APIs #2391
Conversation
Fixes:#2334 |
toStreamD :: MonadIO m => MutArray a -> D.Stream m a | ||
toStreamD arr@MutArray{..} = | ||
{-# INLINE_NORMAL read #-} | ||
read :: MonadIO m => MutArray a -> D.Stream m a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should not be a MonadIO constraint. See the Data.Array API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it uses "getIndexUnsafe" which requires a MonadIO constraint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mutable array. This needs to have a MonadIO constraint.
40a0a50
to
f990b47
Compare
98a3306
to
2180806
Compare
86720de
to
faad01d
Compare
960a6b4
to
cef152c
Compare
{-# INLINE fromStreamN #-} | ||
fromStreamN :: MonadIO m => Int -> Stream m a -> m (MutArray a) | ||
fromStreamN n = D.fold (writeN n) | ||
|
||
{-# INLINE fromStream #-} | ||
fromStream :: MonadIO m => Stream m a -> m (MutArray a) | ||
fromStream = D.fold write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these? INLINE these definations?
e52014d
to
ad90f17
Compare
No description provided.