Newest at the top
| 2025-12-16 00:28:38 +0100 | <chromoblob> | and i have even defined `($$) = flip ($)` in past, to do `... $$ ... $$ ...` - iirc |
| 2025-12-16 00:24:56 +0100 | <chromoblob> | `$` is how i kill parentheses :p |
| 2025-12-16 00:24:43 +0100 | <haskellbridge> | <loonycyborg> +to |
| 2025-12-16 00:24:14 +0100 | <chromoblob> | ... = ... $ do ... |
| 2025-12-16 00:22:41 +0100 | Googulator33 | (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) |
| 2025-12-16 00:22:24 +0100 | Googulator33 | (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-16 00:20:29 +0100 | Sgeo | (~Sgeo@user/sgeo) Sgeo |
| 2025-12-16 00:20:16 +0100 | CiaoSen | (~Jura@2a02:8071:64e1:da0:5a47:caff:fe78:33db) (Ping timeout: 256 seconds) |
| 2025-12-16 00:19:50 +0100 | <haskellbridge> | <loonycyborg> "do" can be used in pure code to together with BlockArguments kill even more parentheses :P |
| 2025-12-16 00:18:07 +0100 | <jackdk> | (And specifies that `fail` is an operation of `class Monad`) |
| 2025-12-16 00:17:31 +0100 | <jackdk> | The H98 report, s3.14, desugars `do { p <- e; stmts }` to `let { ok p = do {stmts}; ok _ = fail "..." in e >>= ok }` |
| 2025-12-16 00:10:17 +0100 | peterbecich | (~Thunderbi@71.84.33.135) peterbecich |
| 2025-12-16 00:06:01 +0100 | <dolio> | Originally I think failable patterns would desugar to MonadZero. |
| 2025-12-16 00:05:46 +0100 | Googulator33 | (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) |
| 2025-12-16 00:05:41 +0100 | Googulator | (~Googulato@2a01-036d-0106-01cb-3c18-a4bd-1bda-7c8b.pool6.digikabel.hu) (Quit: Client closed) |
| 2025-12-16 00:04:43 +0100 | <dolio> | It's fine, just don't put it in Monad. |
| 2025-12-16 00:04:34 +0100 | myxos | (~myxos@2001:579:8380:f20:fbd3:ef8a:e888:18ad) (Ping timeout: 255 seconds) |
| 2025-12-16 00:01:47 +0100 | myxokephale | (~myxos@2001:579:8380:f20:50ce:9e79:bbea:e21f) myxokephale |
| 2025-12-15 23:55:15 +0100 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) (Remote host closed the connection) |
| 2025-12-15 23:55:05 +0100 | humasect | (~humasect@dyn-192-249-132-90.nexicom.net) humasect |
| 2025-12-15 23:48:35 +0100 | <davean> | Not if you don't fuck up designing the language |
| 2025-12-15 23:48:01 +0100 | <tomsmeding> | it is in the desugaring though |
| 2025-12-15 23:47:49 +0100 | <davean> | Thats because fail is an error |
| 2025-12-15 23:47:25 +0100 | <tomsmeding> | (I omitted 'fail' from my desugaring above) |
| 2025-12-15 23:46:56 +0100 | <tomsmeding> | (you can observe this desugaring even more directly if you turn on RebindableSyntax, which just calls whatever (>>=) and (>>) are in scope https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/rebindable_syntax.html#extension-Re… ) |
| 2025-12-15 23:46:13 +0100 | <chromoblob> | i might have known/learned this in past, i just forgot |
| 2025-12-15 23:46:00 +0100 | euphores | (~SASL_euph@user/euphores) euphores |
| 2025-12-15 23:45:46 +0100 | <chromoblob> | ok, i see, `do` is a sugar which desugars trivially in `do x` case |
| 2025-12-15 23:44:38 +0100 | <davean> | chromoblob: the problem here is you think "do" is something it isn't |
| 2025-12-15 23:43:22 +0100 | <lambdabot> | https://hackage.haskell.org/package/acme-dont |
| 2025-12-15 23:43:22 +0100 | <tomsmeding> | @hackage acme-dont |
| 2025-12-15 23:43:08 +0100 | <davean> | do is a way of templating out code |
| 2025-12-15 23:42:49 +0100 | <tomsmeding> | a trivial 'do' like 'do ()' falls in the final, default case and just desugars to '()' |
| 2025-12-15 23:42:46 +0100 | Googulator85 | Googulator |
| 2025-12-15 23:42:38 +0100 | <lambdabot> | (Monad m, Num a) => m a |
| 2025-12-15 23:42:37 +0100 | <chromoblob> | :t do return 5 |
| 2025-12-15 23:42:27 +0100 | <lambdabot> | (Applicative f, Num a) => f a |
| 2025-12-15 23:42:26 +0100 | <chromoblob> | :t do pure 5 |
| 2025-12-15 23:42:26 +0100 | <tomsmeding> | 'do' is syntactic sugar: 'do a; b' ~> 'a >> b'; 'do x <- a; b' ~> 'a >>= \x -> b'; 'do let { x = a }; b' ~> 'let x = a in b'; 'do a' ~> 'a' |
| 2025-12-15 23:42:20 +0100 | michalz | (~michalz@185.246.207.197) (Remote host closed the connection) |
| 2025-12-15 23:42:16 +0100 | <davean> | () is a value and nothing in your do interacts with it |
| 2025-12-15 23:42:03 +0100 | <davean> | do () just becomes () |
| 2025-12-15 23:41:55 +0100 | <davean> | Do desugars procedurally, via monad functions, or applicitive, none of those are used so the resultant code has no issues |
| 2025-12-15 23:41:17 +0100 | <davean> | Its not making it do behave so, its what do is. |
| 2025-12-15 23:40:57 +0100 | <chromoblob> | so, what can i do with this? why make `do` behave so? |
| 2025-12-15 23:40:55 +0100 | <lambdabot> | () |
| 2025-12-15 23:40:55 +0100 | <davean> | :t do (); |
| 2025-12-15 23:40:18 +0100 | <lambdabot> | • In a stmt of a 'do' block: () |
| 2025-12-15 23:40:18 +0100 | <lambdabot> | • Couldn't match expected type ‘m a0’ with actual type ‘()’ |
| 2025-12-15 23:40:18 +0100 | <lambdabot> | error: [GHC-83865] |