Logs: liberachat/#xmonad
| 2022-08-04 14:11:12 | <quarkQuark[m]> | Would this `asks` function mean that I don't have to pass my config to my keybindings as a parameter, or am I misunderstanding? This would seem strange as otherwise my keybindings definition is pure. |
| 2022-08-04 14:12:53 | <geekosaur[m]> | You may have defined them as pure but they run in X |
| 2022-08-04 14:13:41 | <geekosaur[m]> | Otherwise spawning wouldn't work |
| 2022-08-04 14:14:08 | <quarkQuark[m]> | Ah yes, that makes sense thanks! |
| 2022-08-04 14:14:21 | <quarkQuark[m]> | * That's interesting. Currently I'm passing my config record to my keybindings definition as a parameter and calling `spawn (terminal config)` (to avoid annoying type signatures, I define the config with `where` in `main`). |
| 2022-08-04 14:14:21 | <quarkQuark[m]> | Would this `asks` function mean that I don't have to pass my config to my keybindings as a parameter, or am I misunderstanding? This would seem strange as otherwise my keybindings definition is pure. |
| 2022-08-04 14:14:56 | <geekosaur[m]> | If you look at the type it's (String -> X ()) |
| 2022-08-04 14:15:29 | <geekosaur[m]> | Sorry (String, X ()) |
| 2022-08-04 14:16:57 | <quarkQuark[m]> | And everything in X can access my config record using `asks`? |
| 2022-08-04 14:17:17 | <geekosaur[m]> | Yes |
| 2022-08-04 14:19:00 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 2022-08-04 14:22:09 | <geekosaur> | if you want to poke around, `asks` looks things up in `XConf` and `gets` looks things up in `XState`, both of which are defined in `XMonad/Core.hs` |
| 2022-08-04 14:22:54 | <geekosaur> | (the difference is that `XConf` never changes after xmonad starts, while `XState` is the live "mutable" state of xmonad) |
| 2022-08-04 14:23:01 | × | sogens2 quits (~sogens@211.30.173.20) (Ping timeout: 268 seconds) |
| 2022-08-04 14:24:01 | <geekosaur> | btw all that editing works fine in Matrix but it makes a real mess in IRC |
| 2022-08-04 14:25:24 | → | sogens2 joins (~sogens@211.30.173.20) |
| 2022-08-04 14:25:34 | × | Guest833 quits (~Guest83@1.39.30.16) (Ping timeout: 252 seconds) |
| 2022-08-04 14:25:42 | <quarkQuark[m]> | Oh, sorry - I didn't realise this was also on IRC! Does it send a new message each time? I will try not to do that again |
| 2022-08-04 14:25:51 | <geekosaur> | yes |
| 2022-08-04 14:26:17 | <quarkQuark[m]> | Thanks for letting me know |
| 2022-08-04 14:27:23 | <geekosaur> | yeh, we have the Matrix room joined to an IRC channel. it's convenient but gets messy when some of Matrix's fancier features get involved |
| 2022-08-04 14:35:21 | <Solid> | quarkQuark[m]: since you're asking about asks (heh): now is a great time for you to learn about reader monads! :> |
| 2022-08-04 14:45:12 | <quarkQuark[m]> | I suppose I'll give them a 'read'! |
| 2022-08-04 14:46:28 | <Solid> | :^) |
| 2022-08-04 14:46:32 | <geekosaur> | they're not difficult, at least while wrapped in a Reader. (the unwrapped version is somewhat mind-bending, but it's simple and safe while wrapped) |
| 2022-08-04 14:48:25 | × | sogens2 quits (~sogens@211.30.173.20) (Quit: WeeChat 3.5) |
| 2022-08-04 14:48:41 | → | sogens joins (~sogens@211.30.173.20) |
| 2022-08-04 14:49:09 | <geekosaur> | ("safe" with respect to your sanity, that is, there's nothing otherwise unsafe about them) |
| 2022-08-04 15:10:59 | × | diep quits (~diep@2a01:cb11:2d7:4a00:a13f:e40c:c4e8:736c) (Remote host closed the connection) |
| 2022-08-04 15:12:28 | × | sogens quits (~sogens@211.30.173.20) (Quit: WeeChat 3.5) |
| 2022-08-04 15:12:44 | → | sogens joins (~sogens@211.30.173.20) |
| 2022-08-04 15:15:13 | <Hash> | !monad |
| 2022-08-04 15:15:23 | <Hash> | Come on bot! |
| 2022-08-04 15:15:28 | × | sogens quits (~sogens@211.30.173.20) (Client Quit) |
| 2022-08-04 15:15:44 | → | sogens joins (~sogens@211.30.173.20) |
| 2022-08-04 15:17:57 | × | qbt quits (~qbt@user/edun) (Ping timeout: 252 seconds) |
| 2022-08-04 15:23:40 | <geekosaur> | what were you looking for? |
| 2022-08-04 15:24:02 | <geekosaur> | first off, there are only two (known) bots in here and neither responds to ! |
| 2022-08-04 15:24:41 | <geekosaur> | second, the main bot you'd query doesn't accept that. |
| 2022-08-04 15:25:08 | <geekosaur> | @google you could have invented monads |
| 2022-08-04 15:25:23 | <lambdabot> | Plugin `search' failed with: <<timeout>> |
| 2022-08-04 15:25:33 | <geekosaur> | mm, still broken. sad |
| 2022-08-04 15:25:56 | <geekosaur> | http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html |
| 2022-08-04 15:27:08 | <geekosaur> | yes, the concept derives from category theory. but th4ese aren't category theory monads and you don't care about category theory when using or even defining them |
| 2022-08-04 15:30:09 | <geekosaur> | (we don't even define it properly for category theory, that'd be join and fmap instead of return and bind) |
| 2022-08-04 15:31:43 | <Hash> | Oh ok |
| 2022-08-04 15:31:45 | <Hash> | I dunno the bots here yet |
| 2022-08-04 15:32:19 | <Hash> | Category theory. I did some stuff there in algorithm generation |
| 2022-08-04 15:32:28 | <Hash> | Robitics stuff. Fun. |
| 2022-08-04 15:32:50 | <Hash> | I never knew Robots need to generate algorithms for various problems on the fly. |
| 2022-08-04 15:32:59 | <Hash> | Pretty cool. But neither here nor there! |
| 2022-08-04 15:33:06 | <geekosaur> | that's the direction robotics has been going, yes |
| 2022-08-04 15:33:21 | <geekosaur> | because it's what we do, and fixed algorithms don't work well in the real world |
| 2022-08-04 15:49:49 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 2022-08-04 16:00:12 | × | Melkor333[m] quits (~melkor333@2001:470:69fc:105::2:3ef7) (Quit: You have been kicked for being idle) |
| 2022-08-04 16:02:44 | → | Guest8311 joins (~Guest83@114.143.131.219) |
| 2022-08-04 16:03:20 | <Guest8311> | main = xmonad $ def |
| 2022-08-04 16:03:20 | <Guest8311> | { modMask = mod4Mask, |
| 2022-08-04 16:03:21 | <Guest8311> | terminal = "alacritty", |
| 2022-08-04 16:03:21 | <Guest8311> | borderWidth = 0, |
| 2022-08-04 16:03:22 | <Guest8311> | layoutHook = myLayout |
| 2022-08-04 16:03:22 | <Guest8311> | } |
| 2022-08-04 16:03:23 | <Guest8311> | `additionalKeysP` myKeys |
| 2022-08-04 16:03:23 | <Guest8311> | Hey, geekosaur is it okay to override borderwidth in the def block? |
| 2022-08-04 16:04:30 | <geekosaur> | yes |
| 2022-08-04 16:04:46 | <geekosaur> | https://github.com/geekosaur/xmonad.hs/blob/skkukuk/xmonad.hs#L133 |
| 2022-08-04 16:04:46 | <Guest8311> | and if you replied to my text about "moving windows to workspaces" using submaps then I've missed those texts |
| 2022-08-04 16:04:51 | <Guest8311> | I was disconnected |
| 2022-08-04 16:05:35 | <geekosaur> | I think I missed that question |
| 2022-08-04 16:08:21 | <Guest8311> | geekosaur |
| 2022-08-04 16:08:23 | <Guest8311> | ("M-w", submap . M.fromList $ |
| 2022-08-04 16:08:24 | <Guest8311> | [ ((m, k), windows $ f i) |
| 2022-08-04 16:08:24 | <Guest8311> | | (i, k) <- zip myWorkspaces [xK_1 .. xK_9] |
| 2022-08-04 16:08:25 | <Guest8311> | , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] |
| 2022-08-04 16:08:25 | <Guest8311> | -- ((modm, xK_p), toggleWS), |
| 2022-08-04 16:08:26 | <Guest8311> | ]) |
| 2022-08-04 16:08:42 | <Guest8311> | Now the above block changes to a certain workspace using submap |
| 2022-08-04 16:08:57 | <Guest8311> | Is it possible to create a submap to move windows to workspaces? |
| 2022-08-04 16:09:12 | <geekosaur> | that one actually does both |
| 2022-08-04 16:09:26 | <Guest8311> | what's the binding? |
| 2022-08-04 16:09:45 | <Guest8311> | okay |
| 2022-08-04 16:09:53 | <geekosaur> | the shifted version does the move |
| 2022-08-04 16:09:54 | <Guest8311> | mod+w and shift+num |
| 2022-08-04 16:10:07 | <geekosaur> | that's the (W.shift, shiftMask) part |
| 2022-08-04 16:10:36 | <geekosaur> | the first being the operation and the second being the mask, so you could for example change that to controlMask if you wanted |
| 2022-08-04 16:11:01 | <geekosaur> | the various operations you can do with `windows` are in XMonad.StackSet |
| 2022-08-04 16:13:07 | <Guest8311> | I was trying to seperate the moving part into another submap |
| 2022-08-04 16:13:09 | <Guest8311> | ("M-u", submap . M.fromList $ |
| 2022-08-04 16:13:09 | <Guest8311> | [ (f, m) <- [(W.greedyView, 0), (W.shift, [xK_1 .. xK_9])] |
| 2022-08-04 16:13:09 | <Guest8311> | ]) |
| 2022-08-04 16:13:45 | <geekosaur> | you need a bit more to be a proper list comprehension |
| 2022-08-04 16:15:06 | <geekosaur> | [ ((0, k), windows $ shift i) | (i, k) <- zip myWorkspaces [xK_1 .. xK_9] |
| 2022-08-04 16:15:12 | <geekosaur> | whoops |
| 2022-08-04 16:15:15 | <geekosaur> | [ ((0, k), windows $ shift i) | (i, k) <- zip myWorkspaces [xK_1 .. xK_9]] |
| 2022-08-04 16:15:38 | <geekosaur> | still wrong, needs to be W.shift |
| 2022-08-04 16:15:46 | <geekosaur> | but you get the idea, hopefully |
| 2022-08-04 16:16:10 | <geekosaur> | the part before the | is a template for each element of the result list,m the part after it is how to build it |
| 2022-08-04 16:18:48 | <Guest8311> | okay worked |
| 2022-08-04 16:32:01 | <Guest8311> | geekosaur |
| 2022-08-04 16:32:17 | <geekosaur> | yes? |
All times are in UTC.