aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Common.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-02-04 15:20:53 -0700
committerJosh Rahm <joshuarahm@gmail.com>2024-02-04 15:26:10 -0700
commit3a5d965333bb2d7a115e4de05d88ada48fd1d677 (patch)
tree2caa3ff258206e02dcc481c4fe76fe87dcef92a2 /src/Rahm/Desktop/Common.hs
parent07a79849230acba680b04cd0cbad085dfc18217b (diff)
downloadrde-3a5d965333bb2d7a115e4de05d88ada48fd1d677.tar.gz
rde-3a5d965333bb2d7a115e4de05d88ada48fd1d677.tar.bz2
rde-3a5d965333bb2d7a115e4de05d88ada48fd1d677.zip
Overhaul how Wml is implemented.
This adds a new "KeyFeed" monad which is reminiscent of a parsec-type monad. This allows keys like 'g' to be mapped using a subbind and the actual WML part be handled in the catch-all handler. This also significantly cleans up the typing and complexity of the Wml implementation.
Diffstat (limited to 'src/Rahm/Desktop/Common.hs')
-rw-r--r--src/Rahm/Desktop/Common.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Rahm/Desktop/Common.hs b/src/Rahm/Desktop/Common.hs
index 125d651..ae4f531 100644
--- a/src/Rahm/Desktop/Common.hs
+++ b/src/Rahm/Desktop/Common.hs
@@ -20,6 +20,7 @@ module Rahm.Desktop.Common
pointerWindow,
getDisplayAndRoot,
Location (..),
+ Xish(..),
)
where
@@ -246,3 +247,9 @@ duplWindow = runQuery $ do
(a : (init -> as)) -> X.safeSpawn a as
_ -> return ()
Left err -> logs Info "%s" (err :: String)
+
+class (Monad m) => Xish m where
+ liftFromX :: X a -> m a
+
+instance Xish X where
+ liftFromX = id