src/Graphics/UI/GIGtkStrut.hs:58:3: error:
• Could not deduce (Control.Monad.Fail.MonadFail m)
arising from a do statement
with the failable pattern ‘Just monitor’
from the context: MonadIO m
bound by the type signature for:
setupStrutWindow :: forall (m :: * -> *).
MonadIO m =>
StrutConfig -> Gtk.Window -> m ()
at src/Graphics/UI/GIGtkStrut.hs:46:1-66
Possible fix:
add (Control.Monad.Fail.MonadFail m) to the context of
the type signature for:
setupStrutWindow :: forall (m :: * -> *).
MonadIO m =>
StrutConfig -> Gtk.Window -> m ()
• In a stmt of a 'do' block:
Just monitor <- maybe
(Gdk.displayGetPrimaryMonitor display)
(Gdk.displayGetMonitor display)
monitorNumber
In the expression:
do Just display <- maybe
Gdk.displayGetDefault Gdk.displayOpen displayName
Just monitor <- maybe
(Gdk.displayGetPrimaryMonitor display)
(Gdk.displayGetMonitor display)
monitorNumber
screen <- Gdk.displayGetDefaultScreen display
monitorCount <- Gdk.displayGetNMonitors display
....
In an equation for ‘setupStrutWindow’:
setupStrutWindow
StrutConfig {strutWidth = widthSize, strutHeight = heightSize,
strutXPadding = xpadding, strutYPadding = ypadding,
strutMonitor = monitorNumber, strutPosition = position,
strutAlignment = alignment, strutDisplayName = displayName}
window
= do Just display <- maybe
Gdk.displayGetDefault Gdk.displayOpen displayName
Just monitor <- maybe
(Gdk.displayGetPrimaryMonitor display)
(Gdk.displayGetMonitor display)
monitorNumber
screen <- Gdk.displayGetDefaultScreen display
....
|
58 | Just monitor <- maybe (Gdk.displayGetPrimaryMonitor display)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Currently the build fails on GHC 8.6 with:
Adding a MonadFail constraint seems to fix it.
See the MonadFailDesugaring section of https://ghc.haskell.org/trac/ghc/wiki/Migration/8.6.