Merge pull request #398 from liskin/layoutclass-typeable

Add Typeable constraint to a few LayoutClass instances
This commit is contained in:
Brent Yorgey 2020-11-09 14:13:09 -06:00 committed by GitHub
commit e042bcce97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 5 deletions

View File

@ -251,6 +251,11 @@
- Export `Minimize` type constructor.
* Several `LayoutClass` instances now have an additional `Typeable`
constraint which may break some advanced configs. The upside is that we
can now add `Typeable` to `LayoutClass` in `XMonad.Core` and make it
possible to introspect the current layout and its modifiers.
## 0.16
### Breaking Changes

View File

@ -259,7 +259,7 @@ relBox x y w h = SubBox (Rel x) (Rel y) (Rel w) (Rel h)
--------------------------------------------------------------------------------
instance ( LayoutClass l1 a, LayoutClass l2 a
, Read a, Show a, Show p, Eq a, Typeable a, Predicate p a
, Read a, Show a, Show p, Typeable p, Eq a, Typeable a, Predicate p a
) => LayoutClass (LayoutB l1 l2 p) a where
-- | Update window locations.

View File

@ -78,7 +78,7 @@ layoutAll box sub =
let a = alwaysTrue (Proxy :: Proxy a)
in LayoutP Nothing Nothing a box Nothing sub Nothing
instance (LayoutClass l1 w, LayoutClass l2 w, Predicate p w, Show w, Read w, Eq w, Typeable w, Show p) =>
instance (LayoutClass l1 w, LayoutClass l2 w, Predicate p w, Show w, Read w, Eq w, Typeable w, Show p, Typeable p) =>
LayoutClass (LayoutP p l1 l2) w where
-- | Update window locations.

View File

@ -250,7 +250,7 @@ class (Show (m a), Read (m a)) => LayoutModifier m a where
-- | The 'LayoutClass' instance for a 'ModifiedLayout' defines the
-- semantics of a 'LayoutModifier' applied to an underlying layout.
instance (LayoutModifier m a, LayoutClass l a) => LayoutClass (ModifiedLayout m l) a where
instance (LayoutModifier m a, LayoutClass l a, Typeable m) => LayoutClass (ModifiedLayout m l) a where
runLayout (Workspace i (ModifiedLayout m l) ms) r =
do ((ws, ml'),mm') <- modifyLayoutWithUpdate m (Workspace i l ms) r
(ws', mm'') <- redoLayout (maybe m id mm') r ms ws

View File

@ -188,7 +188,7 @@ instance (Transformer a w, HList b w) => HList (HCons a b) w where
geq :: (Typeable a, Eq a, Typeable b) => a -> b -> Bool
geq a b = Just a == cast b
instance (Typeable a, Show ts, HList ts a, LayoutClass l a) => LayoutClass (MultiToggle ts l) a where
instance (Typeable a, Show ts, Typeable ts, HList ts a, LayoutClass l a) => LayoutClass (MultiToggle ts l) a where
description mt = currLayout mt `unEL` \l -> description l
runLayout (Workspace i mt s) r = case currLayout mt of

View File

@ -185,7 +185,7 @@ zoomReset = ZoomTo 1
-- * LayoutClass instance
instance (EQF f a, Show a, Read a, Show (f a), Read (f a))
instance (EQF f a, Show a, Read a, Show (f a), Read (f a), Typeable f)
=> LayoutClass (ZoomRow f) a where
description (ZC _ Nothing) = "ZoomRow"
description (ZC _ (Just s)) = "ZoomRow" ++ if full $ W.focus s