Logs: liberachat/#haskell
| 2026-02-25 18:35:27 | <__monty__> | Indentation in do-notation always trips me up. let ... in ... has no qualms with the definitions being less indented than the let. |
| 2026-02-25 18:35:31 | <ski> | (iow, breaking line after `let', then you can indent the followin lines a little bit less) |
| 2026-02-25 18:36:02 | <Milan_Vanca> | Yeah thy guyz now I get it. :) |
| 2026-02-25 18:36:06 | <Milan_Vanca> | TY |
| 2026-02-25 18:36:14 | <ski> | yea .. the block starts at the first (non-comment) token *after* the layout-introducing keyword (here `let') |
| 2026-02-25 18:36:34 | <ski> | (in Milan_Vanca's case, the block starts at `result') |
| 2026-02-25 18:37:20 | <ski> | (same rule holds for `of', and for `do', and `where') |
| 2026-02-25 18:38:29 | <haskellbridge> | <ijouw> let x = y in and let x = y have same rules reguarding where x may be. Everything y must be indented more than x. |
| 2026-02-25 18:38:39 | <probie> | If you don't want to indent, you can always just use braces |
| 2026-02-25 18:38:40 | × | tromp quits (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2026-02-25 18:39:05 | <ski> | Milan_Vanca : btw, if you wanted to, you could factor out some common code from the two branches |
| 2026-02-25 18:39:09 | → | wickedja` joins (~user@2605:8d80:5430:818:b927:d532:959:409c) |
| 2026-02-25 18:39:30 | <__monty__> | But braces require semicolons, eww. |
| 2026-02-25 18:40:58 | <probie> | Only if you want more than one thing :p |
| 2026-02-25 18:41:03 | × | wickedjargon quits (~user@208.98.208.115) (Ping timeout: 246 seconds) |
| 2026-02-25 18:41:39 | <ski> | let (status,result) = case eitherDecode body of |
| 2026-02-25 18:41:59 | <Milan_Vanca> | I don't think same rules apply for where I can have where\n..something or where\n..................something |
| 2026-02-25 18:42:02 | <ski> | Left e -> (status400,PL.pack e) |
| 2026-02-25 18:42:15 | <ski> | Right c -> (status200,encode (increment c)) |
| 2026-02-25 18:42:28 | <ski> | return (responseLBS status [(hContentType,hvAplicationJSON)] result) |
| 2026-02-25 18:43:08 | <Milan_Vanca> | ski: Nicer solution.. so tuple is ok ni this case? |
| 2026-02-25 18:43:22 | <ski> | Milan_Vanca : yes, it's same rule. `where'-block also starts at whatever column `something' is at, regardless of which column `where' is at |
| 2026-02-25 18:43:41 | <ski> | you can always match on tuples, in `let' and `where' (and toplevel) |
| 2026-02-25 18:44:13 | × | rncwnd quits (~quassel@2a01:4f8:221:27c6::1) (Quit: Later) |
| 2026-02-25 18:44:33 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-25 18:44:49 | → | rncwnd joins (~quassel@2a01:4f8:221:27c6::1) |
| 2026-02-25 18:45:11 | <ski> | (and on other data constructors. however, a value of tuple type can never fail to match a tuple pattern, but for data types with multiple data constructors, you can get match failure, so it's good to only match on those, in `let'/`where'/toplevel sparingly, when you're sure that they won't actually fail ..) |
| 2026-02-25 18:45:19 | <haskellbridge> | <ijouw> counter = fmap (((s,v) -> responseLBS s [(hContentType, hvApplicationJson)] v) . ((status400,) . PL.pack ||| (status200,) . encode . increment)) . lazyRequestBody |
| 2026-02-25 18:45:38 | <ski> | > let x:xs = [] :: [Integer] in (x,xs) |
| 2026-02-25 18:45:40 | <lambdabot> | (*Exception: <interactive>:3:5-26: Non-exhaustive patterns in x : xs |
| 2026-02-25 18:46:03 | <ski> | > let Nothing = Just 3 in () |
| 2026-02-25 18:46:05 | <lambdabot> | () |
| 2026-02-25 18:46:08 | <ski> | > let !Nothing = Just 3 in () |
| 2026-02-25 18:46:10 | <lambdabot> | *Exception: <interactive>:3:5-21: Non-exhaustive patterns in !Nothing |
| 2026-02-25 18:46:48 | <ski> | hah, ijouw :) |
| 2026-02-25 18:47:05 | <haskellbridge> | <ijouw> i did not typecheck it |
| 2026-02-25 18:47:43 | <Milan_Vanca> | ijouw do you really find this more readable? |
| 2026-02-25 18:47:44 | <probie> | > (\xs -> let y:ys = xs in if null xs then Nothing else Just (y, ys)) [] |
| 2026-02-25 18:47:45 | <lambdabot> | Nothing |
| 2026-02-25 18:47:57 | <haskellbridge> | <ijouw> i usually use left to right composition |
| 2026-02-25 18:51:18 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds) |
| 2026-02-25 18:55:45 | <haskellbridge> | <ijouw> Like so |
| 2026-02-25 18:55:45 | <haskellbridge> | ... long message truncated: https://kf8nh.com/_heisenbridge/media/kf8nh.com/ROHzIHXhlwulEzElCZCROwyR/IEURazvg-wM (5 lines) |
| 2026-02-25 18:56:03 | <haskellbridge> | <ijouw> That prints weiredly |
| 2026-02-25 18:56:20 | <haskellbridge> | <ijouw> Some formatting issue |
| 2026-02-25 18:56:45 | <haskellbridge> | <ijouw> https://paste.tomsmeding.com/OUVh8TUU |
| 2026-02-25 18:58:17 | → | uli-fem joins (~uli-fem@118.210.1.123) |
| 2026-02-25 19:00:56 | <haskellbridge> | <ijouw> I think i messed the fmap up |
| 2026-02-25 19:02:36 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-25 19:02:40 | × | uli-fem quits (~uli-fem@118.210.1.123) (Ping timeout: 245 seconds) |
| 2026-02-25 19:03:37 | → | tromp joins (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) |
| 2026-02-25 19:04:07 | → | uli-fem joins (~uli-fem@118.210.1.123) |
| 2026-02-25 19:05:06 | × | tjbc quits (~tjbc@user/fliife) (Ping timeout: 268 seconds) |
| 2026-02-25 19:06:24 | → | tjbc joins (~tjbc@user/fliife) |
| 2026-02-25 19:06:50 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds) |
| 2026-02-25 19:10:39 | × | uli-fem quits (~uli-fem@118.210.1.123) (Ping timeout: 255 seconds) |
| 2026-02-25 19:12:15 | × | tjbc quits (~tjbc@user/fliife) (Ping timeout: 245 seconds) |
| 2026-02-25 19:13:43 | → | tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
| 2026-02-25 19:14:20 | → | Tuplanolla joins (~Tuplanoll@88-114-89-88.elisa-laajakaista.fi) |
| 2026-02-25 19:16:55 | → | tjbc joins (~tjbc@user/fliife) |
| 2026-02-25 19:16:56 | → | merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl) |
| 2026-02-25 19:16:57 | × | prdak quits (~Thunderbi@user/prdak) (Ping timeout: 255 seconds) |
| 2026-02-25 19:22:39 | → | target_i joins (~target_i@user/target-i/x-6023099) |
| 2026-02-25 19:22:50 | → | uli-fem joins (~uli-fem@118.210.1.123) |
| 2026-02-25 19:23:37 | → | Square3 joins (~Square@user/square) |
| 2026-02-25 19:23:50 | × | merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds) |
| 2026-02-25 19:27:05 | × | uli-fem quits (~uli-fem@118.210.1.123) (Ping timeout: 248 seconds) |
| 2026-02-25 19:29:40 | → | Guest8708 joins (~john@user/n0w0n) |
| 2026-02-25 19:30:27 | → | morj_away joins (~morj@user/morj) |
| 2026-02-25 19:31:27 | × | Guest8708 quits (~john@user/n0w0n) (Client Quit) |
| 2026-02-25 19:32:05 | → | n0w0n joins (~john@user/n0w0n) |
| 2026-02-25 19:35:04 | → | prdak joins (~Thunderbi@user/prdak) |
| 2026-02-25 19:39:55 | × | prdak quits (~Thunderbi@user/prdak) (Ping timeout: 264 seconds) |
| 2026-02-25 19:43:34 | → | uli-fem joins (~uli-fem@118.210.1.123) |
| 2026-02-25 19:47:14 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 2026-02-25 19:47:26 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds) |
| 2026-02-25 19:48:00 | × | uli-fem quits (~uli-fem@118.210.1.123) (Ping timeout: 255 seconds) |
| 2026-02-25 19:49:56 | Lord_of_Life_ | is now known as Lord_of_Life |
| 2026-02-25 19:53:50 | → | stackdroid18 joins (~stackdroi@user/stackdroid) |
| 2026-02-25 20:08:22 | × | ctk quits (~calimero@ctkarch.org) (Changing host) |
| 2026-02-25 20:08:22 | → | ctk joins (~calimero@user/calimeroteknik) |
| 2026-02-25 20:11:21 | × | wickedja` quits (~user@2605:8d80:5430:818:b927:d532:959:409c) (Ping timeout: 246 seconds) |
| 2026-02-25 20:13:15 | ctk | is now known as CalimeroTeknik |
| 2026-02-25 20:20:10 | × | Pozyomka quits (~pyon@user/pyon) (Ping timeout: 245 seconds) |
| 2026-02-25 20:20:35 | → | Pozyomka joins (~pyon@user/pyon) |
| 2026-02-25 20:20:48 | × | fgarcia quits (~lei@user/fgarcia) (Ping timeout: 246 seconds) |
| 2026-02-25 20:24:55 | × | machinedgod quits (~machinedg@d172-219-48-230.abhsia.telus.net) (Ping timeout: 264 seconds) |
| 2026-02-25 20:31:52 | × | dtman34 quits (~dtman34@2601:447:d183:2302:b0c5:8965:1c3f:d560) (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in) |
| 2026-02-25 20:32:13 | → | dtman34 joins (~dtman34@2601:447:d183:2302:b0c5:8965:1c3f:d560) |
| 2026-02-25 20:36:22 | × | Square3 quits (~Square@user/square) (Ping timeout: 256 seconds) |
| 2026-02-25 20:43:22 | → | pavonia joins (~user@user/siracusa) |
| 2026-02-25 20:45:58 | → | Googulator88 joins (~Googulato@2a01-036d-0106-499d-5cc3-861f-fb3b-e380.pool6.digikabel.hu) |
| 2026-02-25 20:47:34 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 2026-02-25 20:50:33 | × | Googulator quits (~Googulato@2a01-036d-0106-499d-1c5a-0e4b-5795-d7e3.pool6.digikabel.hu) (Ping timeout: 272 seconds) |
| 2026-02-25 20:53:36 | × | Milan_Vanca quits (~milan@88.212.61.169) (Quit: WeeChat 4.7.2) |
| 2026-02-25 20:57:33 | × | takuan quits (~takuan@d8D86B9E9.access.telenet.be) (Ping timeout: 246 seconds) |
| 2026-02-25 20:59:44 | × | tromp quits (~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2026-02-25 21:02:06 | × | kaankeskin quits (~kaankeski@user/kaankeskin) (Quit: Ping timeout (120 seconds)) |
| 2026-02-25 21:03:09 | × | gAy_Dragon quits (A_D@libera/staff/dragon) (Quit: ZNC - https://znc.in) |
| 2026-02-25 21:06:02 | × | morj_away quits (~morj@user/morj) (Quit: Konversation terminated!) |
All times are in UTC.