Fix Haskell2010 incompatibilities

This commit is contained in:
Tomas Janousek 2021-10-27 18:06:41 +01:00
parent 991dc6dfac
commit 0fde4c8848
3 changed files with 16 additions and 16 deletions

View File

@ -88,8 +88,8 @@ getScreen (ScreenComparator cmpScreen) (P i) = do w <- gets windowset
viewScreen :: ScreenComparator -> PhysicalScreen -> X () viewScreen :: ScreenComparator -> PhysicalScreen -> X ()
viewScreen sc p = do i <- getScreen sc p viewScreen sc p = do i <- getScreen sc p
whenJust i $ \s -> do whenJust i $ \s -> do
w <- screenWorkspace s w <- screenWorkspace s
whenJust w $ windows . W.view whenJust w $ windows . W.view
-- | Send the active window to a given physical screen -- | Send the active window to a given physical screen
sendToScreen :: ScreenComparator -> PhysicalScreen -> X () sendToScreen :: ScreenComparator -> PhysicalScreen -> X ()

View File

@ -152,12 +152,12 @@ debugEventsHook' PropertyEvent {ev_window = w
a' <- atomName a a' <- atomName a
-- too many of these, and they're not real useful -- too many of these, and they're not real useful
if a' == "_NET_WM_USER_TIME" then return () else do if a' == "_NET_WM_USER_TIME" then return () else do
windowEvent "Property on" w windowEvent "Property on" w
s' <- case s of s' <- case s of
1 -> return "deleted" 1 -> return "deleted"
0 -> dumpProperty a a' w (7 + length a') 0 -> dumpProperty a a' w (7 + length a')
_ -> error "Illegal propState; Xlib corrupted?" _ -> error "Illegal propState; Xlib corrupted?"
say " atom" $ a' ++ s' say " atom" $ a' ++ s'
debugEventsHook' ExposeEvent {ev_window = w debugEventsHook' ExposeEvent {ev_window = w
} = } =
@ -812,10 +812,10 @@ dumpUTF :: Decoder Bool
dumpUTF = do dumpUTF = do
uTF8_STRING <- inX $ getAtom "UTF8_STRING" uTF8_STRING <- inX $ getAtom "UTF8_STRING"
guardType uTF8_STRING $ guardSize 8 $ do guardType uTF8_STRING $ guardSize 8 $ do
s <- gets value s <- gets value
modify (\r -> r {value = []}) modify (\r -> r {value = []})
append . show . decode . map fromIntegral $ s append . show . decode . map fromIntegral $ s
return True return True
-- dump an enumerated value using a translation table -- dump an enumerated value using a translation table
dumpEnum' :: [String] -> Atom -> Decoder Bool dumpEnum' :: [String] -> Atom -> Decoder Bool

View File

@ -273,10 +273,10 @@ instance SetsAmbiguous Ambiguity where
guard $ case amb of guard $ case amb of
OnlyLayoutFloatBelow -> OnlyLayoutFloatBelow ->
let vu = do let vu = do
gr <- sr `R.difference` lr gr <- sr `R.difference` lr
(i2,_w2,wr2) <- ts ++ fs (i2,_w2,wr2) <- ts ++ fs
guard $ i2 < i1 guard $ i2 < i1
[wr2 `R.intersects` gr] [wr2 `R.intersects` gr]
in lr == wr1 && (not . or) vu in lr == wr1 && (not . or) vu
OnlyLayoutFloat -> OnlyLayoutFloat ->
lr == wr1 lr == wr1