-
Notifications
You must be signed in to change notification settings - Fork 149
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
Build with ghc(js) 9.8.2 + 9.10.1 #502
base: develop
Are you sure you want to change the base?
Conversation
313a9b1
to
b62dfbc
Compare
Needs reflex-frp/patch#56 to be in hackage to pass the CI. |
Hoping to land #499 first to separate warnings/cabal cleanup vs new versions a bit. |
PR #502 contains some other orthogonal cleanups.
PR #502 contains some other orthogonal cleanups.
PR #502 contains some other orthogonal cleanups.
@@ -679,15 +678,12 @@ instance (Reflex t, IsString a) => IsString (Behavior t a) where | |||
|
|||
instance Reflex t => Monad (Behavior t) where | |||
a >>= f = pull $ sample a >>= sample . f | |||
-- Note: it is tempting to write (_ >> b = b); however, this would result in (fail x >> return y) succeeding (returning y), which violates the law that (a >> b = a >>= \_ -> b), since the implementation of (>>=) above actually will fail. Since we can't examine 'Behavior's other than by using sample, I don't think it's possible to write (>>) to be more efficient than the (>>=) above. |
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.
@ryantrinkle is this concern gone now that MonadFail got pulled out?
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.
Yeah, we could use the simpler implementation now.
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] | ||
install [] p = do | ||
liftIO $ putStrLn $ showSDocUnsafe $ ppr p | ||
let f = \case | ||
simpl@(CoreDoSimplify _) -> [CoreDoSpecialising, simpl] | ||
x -> [x] | ||
return $ makeInlinable : concatMap f p | ||
install options@(_:_) p = do | ||
msg MCInfo $ "Reflex.Optimizer: ignoring " <> fromString (show $ length options) <> " command-line options" | ||
install [] p | ||
|
||
makeInlinable :: CoreToDo | ||
makeInlinable = CoreDoPluginPass "MakeInlinable" $ \modGuts -> do | ||
let f v = setIdInfo v $ let i = idInfo v in | ||
setInlinePragInfo i $ let p = inlinePragInfo i in | ||
if isDefaultInlinePragma p | ||
then defaultInlinePragma { inl_inline = Inlinable (inl_src p) } | ||
else p | ||
newBinds = flip map (mg_binds modGuts) $ \case | ||
NonRec b e -> NonRec (f b) e | ||
Rec bes -> Rec $ map (first f) bes | ||
return $ modGuts { mg_binds = newBinds } |
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.
Why duplicate this?
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.
They differ for different GHC versions:
reflex/src/Reflex/Optimizer.hs
Line 77 in 0bf60ac
simpl@(CoreDoSimplify _ _) -> [CoreDoSpecialising, simpl] |
vs
reflex/src/Reflex/Optimizer.hs
Line 47 in 0bf60ac
simpl@(CoreDoSimplify _) -> [CoreDoSpecialising, simpl] |
reflex/src/Reflex/Optimizer.hs
Line 59 in 0bf60ac
then defaultInlinePragma { inl_inline = Inlinable (inl_src p) } |
vs
reflex/src/Reflex/Optimizer.hs
Line 89 in 0bf60ac
then defaultInlinePragma { inl_inline = Inlinable } |
You could of course separate the common logic and reuse in both, but IMO time spent on trying to do so is simply not worth it.
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.
We could just delete "Reflex Optimizer" completely. It never really worked very well.
Needs reflex-frp/patch#56.
For
haskell.nix
:default.nix
:shell.nix
:For
nixpkgs
:From
patch
PR: