2026/01/05

Newest at the top

2026-01-05 02:34:16 +0100 <haskellbridge> <loonycyborg> Sometimes should be converted into "fail"
2026-01-05 02:34:02 +0100 <c_wraith> yeah, just the usual error about a pattern match failure
2026-01-05 02:33:45 +0100 <haskellbridge> <loonycyborg> Same thing as usual?
2026-01-05 02:33:33 +0100 <haskellbridge> <loonycyborg> and what happens in case of non-exhaustive match at runtime?
2026-01-05 02:33:17 +0100 <haskellbridge> <loonycyborg> Ah makes sense I guess
2026-01-05 02:32:14 +0100 <c_wraith> loonycyborg: You need the BangPatterns extension, then you mark the match with !
2026-01-05 02:31:49 +0100 <haskellbridge> <loonycyborg> Like you said they're irrefutable "by default"
2026-01-05 02:31:47 +0100 <haskellbridge> <loonycyborg> How can you make patterns in let and where refutable?
2026-01-05 02:30:33 +0100 <int-e> c_wraith: yes
2026-01-05 02:29:56 +0100 <c_wraith> Yeah. "irrefutable" is a slightly weird way of saying "trust the programmer, you don't need to check this immediately"
2026-01-05 02:29:49 +0100 <oats> t'would appear
2026-01-05 02:29:40 +0100 <yahb2> *** Exception: Prelude.undefined ; ; HasCallStack backtrace: ; undefined, called at <interactive>:157:6 in interactive:Ghci16
2026-01-05 02:29:40 +0100 <oats> % case undefined of ~(a,b) -> b
2026-01-05 02:29:09 +0100 <oats> and irrefutable patterns are lazy?
2026-01-05 02:28:50 +0100 <c_wraith> int-e: ah, you're still running lambdabot? I wasn't sure.
2026-01-05 02:28:40 +0100 <int-e> (lamdbabot was perfectly alive, just not joined here)
2026-01-05 02:28:39 +0100jj_jj
2026-01-05 02:28:39 +0100jj(~apropos@d154-20-120-135.bchsia.telus.net) (Ping timeout: 244 seconds)
2026-01-05 02:28:11 +0100 <int-e> it probably got blocked by +r
2026-01-05 02:28:00 +0100 <yahb2> *** Exception: Prelude.undefined ; ; HasCallStack backtrace: ; undefined, called at <interactive>:155:6 in interactive:Ghci16
2026-01-05 02:28:00 +0100 <oats> % case undefined of (a,b) -> ()
2026-01-05 02:27:59 +0100jj_(~apropos@node-1w7jr9pqogh9vahu1mvneock5.ipv6.telus.net) omentic
2026-01-05 02:27:35 +0100 <lambdabot> ()
2026-01-05 02:27:34 +0100 <c_wraith> > case undefined of ~(a, b) -> () -- you can use ~ to make a match in a case irrefutable
2026-01-05 02:26:26 +0100 <EvanR> wow
2026-01-05 02:26:15 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 240 seconds)
2026-01-05 02:25:00 +0100divlamir(~divlamir@user/divlamir) divlamir
2026-01-05 02:24:57 +0100 <c_wraith> EvanR: Irrefutable matches just create thunks. and in a let/where, matches are irrefutable by default.
2026-01-05 02:24:49 +0100divlamir(~divlamir@user/divlamir) (Read error: Connection reset by peer)
2026-01-05 02:24:21 +0100ChanServ+v lambdabot
2026-01-05 02:24:21 +0100lambdabot(~lambdabot@haskell/bot/lambdabot) lambdabot
2026-01-05 02:24:09 +0100 <yahb2> <interactive>:153:5: warning: [GHC-53633] [-Woverlapping-patterns] ; Pattern match is redundant ; In a pattern binding: Just x = ... ; ; ()
2026-01-05 02:24:09 +0100 <EvanR> % let Just x = Nothing in ()
2026-01-05 02:23:32 +0100 <c_wraith> Well, anyway. (let Just x = Nothing in ()) evaluates to (). (case Nothing of Just x -> ()) is a pattern match error.
2026-01-05 02:23:30 +0100 <EvanR> doesn't immediately evaluate?
2026-01-05 02:23:15 +0100 <EvanR> but let Pattern x y z = hopefullyPattern in e ?
2026-01-05 02:22:53 +0100 <EvanR> let x = whatever in y, a thunk makes sense
2026-01-05 02:22:25 +0100 <c_wraith> huh. lambdabot isn't in here right now
2026-01-05 02:21:38 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-05 02:21:38 +0100 <c_wraith> > let Just x = Nothing in ()
2026-01-05 02:21:14 +0100 <c_wraith> let/where create a thunk when they match on a pattern. case forces evaluation.
2026-01-05 02:20:37 +0100 <oats> why does so much code in base and ghc use `case` for binding instead of `let` or `where`? like here: https://hackage-content.haskell.org/package/ghc-internal-9.1401.0/docs/src/GHC.Internal.Arr.html#n…
2026-01-05 02:20:10 +0100Tuplanolla(~Tuplanoll@88-114-88-95.elisa-laajakaista.fi) (Quit: Leaving.)
2026-01-05 02:11:02 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-01-05 02:09:49 +0100jmcantrell_(~weechat@user/jmcantrell) jmcantrell
2026-01-05 02:08:47 +0100omidmash1omidmash
2026-01-05 02:08:47 +0100omidmash(~omidmash@user/omidmash) (Ping timeout: 256 seconds)
2026-01-05 02:06:30 +0100omidmash1(~omidmash@user/omidmash) omidmash
2026-01-05 02:05:54 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-01-05 01:55:13 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)