-
Notifications
You must be signed in to change notification settings - Fork 37
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
dunai
: Remove deprecated definitions
#445
Comments
If someone wants to do this, please go ahead and send a PR. Please create 5 commits:
Please check out the recent history of this repository to see how we normally document commits, and how we link commits to issues in the subject line of the commit messages. |
dunai
dunai
: Remove deprecated definitions
There are a few issues with
Mind if I adjust the import qualifiers? |
Oh we can just remove
Do we want the Yampa or Dunai |
For the second issue, it sounds like maybe bearriver's Let met think about that for a bit and come back to this. Thanks for the great catch! |
I'm not sure if this is correct but you could recursively
|
I wonder if it's possible to also do it by wrapping the identity-based SF into one in an arbitrary monad with https://hackage.haskell.org/package/dunai-0.13.2/docs/Data-MonadicStreamFunction-Core.html#v:morphS |
Could you do something like: reactimate :: Monad m
=> m a -- ^ Initialization action
-> (Bool -> m (DTime, Maybe a)) -- ^ Input sensing action
-> (Bool -> b -> m Bool) -- ^ Actuation (output processing)
-- action
-> SF a b -- ^ Signal function
-> m ()
reactimate senseI sense actuate sf =
BearRiver.reactimate senseI sense actuate (foldIdentity sf)
where
foldIdentity :: Monad m => MSF Identity (DTime, a) b -> MSF m (DTime, a) b
foldIdentity (MSF k) = MSF $ \ta -> pure $ fmap foldIdentity $ runIdentity $ k ta or reactimate :: Monad m
=> m a -- ^ Initialization action
-> (Bool -> m (DTime, Maybe a)) -- ^ Input sensing action
-> (Bool -> b -> m Bool) -- ^ Actuation (output processing)
-- action
-> SF a b -- ^ Signal function
-> m ()
reactimate senseI sense actuate sf =
BearRiver.reactimate senseI sense actuate (foldIdentity sf)
where
foldIdentity :: Monad m => MSF Identity (DTime, a) b -> MSF m (DTime, a) b
foldIdentity = morphS (return . runIdentity) |
Oh nice, I hadn't seen |
@solomon-b Yes. I've just opened a separate issue #454 to address that concern specifically. |
dunai includes several deprecated definitions that were deprecated three versions ago when support for using list-transformer (instead of list-t) was introduced. As per our policy of waiting three versions since deprecation until a function is removed, these definitions can be safely removed. This commit removes the deprecated functions, changes the GHC options and all conditionals related to picking different versions of ListT, and all related imports. The documentation is adjusted to remove the mention on the list monad having constraints on the monad it is applied to.
A prior commit has made using list-transformer the only option available for a ListT monad due to the older interface having been deprecated more than three versions ago. This commit adjusts dependencies so that that package list-transformer is always picked, and removes the related flag since it is now no longer optional.
A prior commit has made using list-transfomer the library providing an implementation of ListT used by dunai. This commit adjusts an example to use the same interface. We further adjust the use of the function widthFirst instead of a custom implementation of equivalent behavior.
dunai
includes several deprecated definitions that were deprecated three versions ago (see #418). They can safely be removed.The text was updated successfully, but these errors were encountered: