Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,791,662 events total
2026-04-07 07:15:00 Square2 joins (~Square4@user/square)
2026-04-07 07:18:55 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-04-07 07:19:04 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2026-04-07 07:24:14 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-04-07 07:29:53 craunts795335385 joins (~craunts@152.32.99.2)
2026-04-07 07:39:23 danza joins (~danza@user/danza)
2026-04-07 08:02:02 × ft quits (~ft@p508db341.dip0.t-ipconnect.de) (Quit: leaving)
2026-04-07 08:04:21 sord937 joins (~sord937@gateway/tor-sasl/sord937)
2026-04-07 08:09:09 × emmanuelux quits (~em@user/emmanuelux) (Quit: bye)
2026-04-07 08:09:46 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 276 seconds)
2026-04-07 08:16:31 arandombit joins (~arandombi@2a02:2455:8656:7100:2967:7abf:4b48:f685)
2026-04-07 08:16:31 × arandombit quits (~arandombi@2a02:2455:8656:7100:2967:7abf:4b48:f685) (Changing host)
2026-04-07 08:16:31 arandombit joins (~arandombi@user/arandombit)
2026-04-07 08:22:07 chromoblob joins (~chromoblo@user/chromob1ot1c)
2026-04-07 08:30:44 × wickedja` quits (~user@2605:8d80:5430:835f:a541:6494:f3cf:c7d9) (Remote host closed the connection)
2026-04-07 08:46:00 xff0x_ joins (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp)
2026-04-07 08:46:37 × xff0x quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 244 seconds)
2026-04-07 08:48:33 acidjnk_new joins (~acidjnk@p200300d6e700e5083e6a4b02e30f35b3.dip0.t-ipconnect.de)
2026-04-07 08:58:27 <ski> "if the argument is zero-size, does it exist?" -- yes
2026-04-07 09:00:51 × sm__ quits (~sm@66.8.200.171) (Ping timeout: 246 seconds)
2026-04-07 09:06:21 <gentauro> ski: empty set?
2026-04-07 09:09:22 × puke quits (~puke@user/puke) (Ping timeout: 250 seconds)
2026-04-07 09:09:55 puke joins (~puke@user/puke)
2026-04-07 09:17:40 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 245 seconds)
2026-04-07 09:32:10 arandombit joins (~arandombi@user/arandombit)
2026-04-07 09:36:47 sixfourtwelve joins (~ethanmorg@static.82.129.225.46.clients.your-server.de)
2026-04-07 09:37:14 sixfourtwelve parts (~ethanmorg@static.82.129.225.46.clients.your-server.de) ()
2026-04-07 10:07:19 danz29182 joins (~danza@user/danza)
2026-04-07 10:09:18 × danza quits (~danza@user/danza) (Ping timeout: 255 seconds)
2026-04-07 10:10:05 acidjnk_new3 joins (~acidjnk@p200300d6e700e57155f396ad0c3fa022.dip0.t-ipconnect.de)
2026-04-07 10:11:38 × tcard quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Remote host closed the connection)
2026-04-07 10:11:53 tcard joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303)
2026-04-07 10:12:24 × xff0x_ quits (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) (Ping timeout: 265 seconds)
2026-04-07 10:13:06 × acidjnk_new quits (~acidjnk@p200300d6e700e5083e6a4b02e30f35b3.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2026-04-07 10:20:34 <probie> Without a zero-size argument, GHC can't produce code to `launchMissiles` (or whatever your preferred obviously side-effecting action is)
2026-04-07 10:28:42 __monty__ joins (~toonn@user/toonn)
2026-04-07 10:28:55 × Igloo quits (~ian@81.2.99.210) (Ping timeout: 244 seconds)
2026-04-07 10:33:55 × CiaoSen quits (~Jura@p549cb690.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2026-04-07 10:37:35 × Googulator72 quits (~Googulato@2a01-036d-0106-496b-154a-c7fc-9f43-bd2d.pool6.digikabel.hu) (Quit: Client closed)
2026-04-07 10:37:50 Googulator72 joins (~Googulato@2a01-036d-0106-496b-154a-c7fc-9f43-bd2d.pool6.digikabel.hu)
2026-04-07 10:39:15 CiaoSen joins (~Jura@p549cb690.dip0.t-ipconnect.de)
2026-04-07 10:39:29 Googulator83 joins (~Googulato@2a01-036d-0106-496b-154a-c7fc-9f43-bd2d.pool6.digikabel.hu)
2026-04-07 10:39:29 × Googulator72 quits (~Googulato@2a01-036d-0106-496b-154a-c7fc-9f43-bd2d.pool6.digikabel.hu) (Client Quit)
2026-04-07 10:45:54 Igloo joins (~ian@81.2.99.210)
2026-04-07 10:48:58 × mniip quits (mniip@libera/staff-emeritus/mniip) (Ping timeout: 268 seconds)
2026-04-07 10:54:15 <ski> gentauro : no, singleton set/type
2026-04-07 10:54:28 × craunts795335385 quits (~craunts@152.32.99.2) (Quit: The Lounge - https://thelounge.chat)
2026-04-07 10:54:44 <ski> empty set/type would represent a computation which does not return
2026-04-07 10:55:35 craunts795335385 joins (~craunts@152.32.99.2)
2026-04-07 10:56:19 <ski> two-logarithm of number of possible values, gives (rounding up) number of bits to represent all the values (assuming a representation using the same number of bits, corresponding to considering each possible value equally likely/important)
2026-04-07 10:56:36 <ski> > logBase 2 256
2026-04-07 10:56:38 <lambdabot> 8.0
2026-04-07 10:56:43 × CiaoSen quits (~Jura@p549cb690.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2026-04-07 10:56:53 <ski> for `256' values in a `Word8', you need eight bits
2026-04-07 10:56:55 <ski> > logBase 2 2
2026-04-07 10:56:57 <lambdabot> 1.0
2026-04-07 10:57:07 <ski> for `2' values, in a `Bool', you need one bit
2026-04-07 10:57:12 <ski> > logBase 2 1
2026-04-07 10:57:13 <lambdabot> 0.0
2026-04-07 10:57:40 <ski> for one single possible value, in a singleton type (like `()'), you need zero bits
2026-04-07 10:57:57 <ski> then boxing, and non-strictness, adds overhead over this
2026-04-07 10:58:08 <ski> > logBase 2 0
2026-04-07 10:58:09 <lambdabot> -Infinity
2026-04-07 10:58:23 <int-e> (give me an element of the empty set and I'll compress all your data)
2026-04-07 10:59:00 <ski> for an empty type, the same formula gives negative infinity number of bits .. but here the reasoning breaks down. since there is no value in the type, you can't represent it, so the question of how many bits it takes doesn't come up
2026-04-07 10:59:35 <ski> for a singleton type, there's no need to represent distinctions, so you need zero bits, so you don't need to reserve memory in RAM, or a register
2026-04-07 10:59:41 <ski> hehe, int-e
2026-04-07 11:00:26 × Igloo quits (~ian@81.2.99.210) (Ping timeout: 244 seconds)
2026-04-07 11:00:34 <ski> in Haskell (ignoring non-strictness), `Void' (not to be confused with the `void' of C,C++,Java,C#, which is more like `()' in Haskell) would be an empty type
2026-04-07 11:00:53 <ski> data Void -- zero alternative consstructors given
2026-04-07 11:01:02 <ski> and then you can define
2026-04-07 11:01:05 mniip joins (mniip@libera/staff-emeritus/mniip)
2026-04-07 11:01:06 <ski> void :: Void -> a
2026-04-07 11:01:13 <ski> void v = case v of {}
2026-04-07 11:01:37 <ski> since there's no possible values, you need to give zero branches in the `case'-`of'
2026-04-07 11:03:01 <ski> `Void' can be occasionally useful, in Haskell, if you have a parameterized type `F', and you're using it as `F Int', `F [String]' or whatever, but sometimes you don't want to allow any value of type `a' in a value of type `F a' (presumably there are values which have zero `a's), and then you can use `F Void'
2026-04-07 11:03:18 × Googulator83 quits (~Googulato@2a01-036d-0106-496b-154a-c7fc-9f43-bd2d.pool6.digikabel.hu) (Quit: Client closed)
2026-04-07 11:03:24 Googulator42 joins (~Googulato@2a01-036d-0106-496b-154a-c7fc-9f43-bd2d.pool6.digikabel.hu)
2026-04-07 11:03:32 <ski> @hoogle exitWith
2026-04-07 11:03:33 <lambdabot> System.Exit exitWith :: ExitCode -> IO a
2026-04-07 11:03:33 <lambdabot> Protolude exitWith :: ExitCode -> IO a
2026-04-07 11:03:33 <lambdabot> Relude.Lifted.Exit exitWith :: MonadIO m => ExitCode -> m a
2026-04-07 11:04:30 <ski> `exitWith' could have had type `ExitCode -> IO Void', would have served the same purpose, showing that it does not return (monadically) normally. the same would be the case for throwing an I/O exception
2026-04-07 11:04:52 <ski> @hoogle throwIO
2026-04-07 11:04:53 <lambdabot> Control.Exception throwIO :: (HasCallStack, Exception e) => e -> IO a
2026-04-07 11:04:53 <lambdabot> Control.Exception.Base throwIO :: (HasCallStack, Exception e) => e -> IO a
2026-04-07 11:04:53 <lambdabot> GHC.IO throwIO :: (HasCallStack, Exception e) => e -> IO a
2026-04-07 11:06:07 <ski> but, then you'd need to use `void' above (called `absurd' in `Data.Void'), to be able to invoke it in any context, e.g. in a branch that should abort, while another branch returns some value of some particular type (distinct from `Void')
2026-04-07 11:09:12 <ski> .. i did a cooperative concurrency monad thing, where i could fork off a (user-level) thread. i wanted the spawned thread to always end by invoking an operation `endThread'. at first (iirc) i used `endThread :: M a' and `forkThread :: M a -> M ()', but i had some `undefined's sprinkled through the implementation of the operations, which i wanted to remove
2026-04-07 11:09:44 × somemathguy quits (~somemathg@user/somemathguy) (Ping timeout: 244 seconds)
2026-04-07 11:09:53 <ski> so, i changed to `endThread :: M Void' and `forkThread :: M Void -> M ()', which allowed me to confidently then remove the `undefined's
2026-04-07 11:10:54 <gentauro> ski: is there a way to "enforce" non-usage of `undefined` in a code base?
2026-04-07 11:11:20 <ski> another example. you can e.g. make a type `Expr var', for representing some kind of expressions, where `var' is a type of free variable identifiers. in that case, `Expr Void' means an expression with no (free) variables
2026-04-07 11:12:02 <ski> i think there's some tool to look for potential problems with partial operations (of which `undefined' is a blatant case), but i forgot the name, gentauro
2026-04-07 11:15:10 <gentauro> hmmmm
2026-04-07 11:15:31 merijn joins (~merijn@77.242.116.146)
2026-04-07 11:16:12 × danz29182 quits (~danza@user/danza) (Remote host closed the connection)
2026-04-07 11:16:45 xff0x joins (~xff0x@ai112096.d.east.v6connect.net)
2026-04-07 11:22:10 × arandombit quits (~arandombi@user/arandombit) (Remote host closed the connection)
2026-04-07 11:37:13 × tromp quits (~textual@2001:1c00:340e:2700:8cf8:7bb7:a0e:7cfa) (Quit: My iMac has gone to sleep. ZZZzzz…)

All times are in UTC.