turion / rhine

Haskell Functional Reactive Programming framework with type-level clocks
http://hackage.haskell.org/package/rhine
122 stars 21 forks source link

Add support for dunai 0.11 #251

Closed blackheaven closed 11 months ago

blackheaven commented 1 year ago

I'm a bit struggling with instances:

src/FRP/Rhine/ClSF/Util.hs:338:19: error:
    • Could not deduce (Floating
                          (MSF (Control.Monad.Trans.Reader.ReaderT (TimeInfo cl) m) v s))
        arising from a use of ‘^-^’
      from the context: (Monad m, Eq s, Floating s, VectorSpace v s,
                         s ~ Diff td, td ~ Time cl)
        bound by the type signature for:
                   highPass :: forall (m :: Type -> Type) s v td.
                               (Monad m, Eq s, Floating s, VectorSpace v s, s ~ Diff td) =>
                               Diff td -> BehaviourF m td v v
        at src/FRP/Rhine/ClSF/Util.hs:(328,1)-(337,21)
    • In the expression: clId ^-^ lowPass t
      In an equation for ‘highPass’: highPass t = clId ^-^ lowPass t
    |
338 | highPass t = clId ^-^ lowPass t
    |                   ^^^

which is weird since:

instance (Monad m, Eq s, Num s, VectorSpace v s, Floating (MSF m a s)) => VectorSpace (MSF m a v) (MSF m a s)
instance (Monad m, Floating b) => Floating (MSF m a b)

If anyone can have a look

turion commented 1 year ago

I'm a bit struggling with instances:

Ah yes, that one is really tricky, it took me some time. You need:

import Data.MonadicStreamFunction.Instances.Num ()
turion commented 1 year ago

I think you're actually bumping the dunai version, and not so much the GHC version, right?

blackheaven commented 1 year ago

Ah yes, that one is really tricky, it took me some time. You need:

Thank you so much!

blackheaven commented 1 year ago

I think you're actually bumping the dunai version, and not so much the GHC version, right?

and simple-affine-space, but that's the only blockers to GHC 9.4 support.

turion commented 1 year ago

But GHC 9.4 is already supported in rhine. I think to support 9.6, one needs to bump dunai, but I'm not sure. The issue with 9.4 is only that the dependency monad-bayes didn't support 9.4 for a long time. But it does now, I think we just need to enable the CI jobs again.

turion commented 1 year ago

But to support GHC 9.6, one would also need to make changes to the TestedWith section in rhine.cabal, and the CI files. If you want to land a simpler PR, how about just renaming it to "Bump dunai to 0.11", and drop the changed base version constraints?

blackheaven commented 1 year ago

But GHC 9.4 is already supported in rhine. I think to support 9.6, one needs to bump dunai, but I'm not sure. The issue with 9.4 is only that the dependency monad-bayes didn't support 9.4 for a long time. But it does now, I think we just need to enable the CI jobs again.

I see, when I tried, I have just updated flake.lock and I have got issues I have attributed to GHC 9.4, which in fact where packages set changes.

I have monad-bayes on my list, once done, I'll come back to finish the work :)

turion commented 12 months ago

Can you fix fourmolu and the remaining build errors?

blackheaven commented 12 months ago

I had a fix, I forgot to push it :/

blackheaven commented 11 months ago

Is there anything I can do to make the PR move forward?

turion commented 11 months ago

Sorry, I overlooked that there was already a PR open to fix this in https://github.com/turion/rhine/pull/249 :( It was open since longer and I wasn't sure it would be merged. Thank you anyways!