2025/12/04

Newest at the top

2025-12-04 20:11:47 +0100gehmehgehgmg
2025-12-04 20:08:21 +0100 <mauke> but the exponent is required
2025-12-04 20:08:15 +0100 <mauke> kind of. perl supports 0o0.4p0
2025-12-04 20:07:12 +0100ski. o O ( `0o0.4' )
2025-12-04 20:05:13 +0100 <int-e> But not Pike (which is another branch of LPC), so I think the caveat is important.
2025-12-04 20:03:40 +0100 <int-e> Rust too. The aforementioned LPC too (at least in its modern ldmud dialect).
2025-12-04 20:03:39 +0100 <c_wraith> actually, I guessed it based on the syntax provided in the binary literals extension rather than looking for a reference. at least things are consistent
2025-12-04 20:03:29 +0100 <mauke> nice
2025-12-04 20:02:03 +0100 <int-e> let's see.. Python 3 does it and forbids leading zeros in decimal literals on top of that
2025-12-04 19:59:02 +0100 <mauke> do any other programming languages (outside of Perl/Haskell) support 0o notation?
2025-12-04 19:57:46 +0100 <haskellbridge> <loonycyborg> Probably it's possible to write a function that will map on the element number in tuple that you specify as type level Natural :P
2025-12-04 19:57:36 +0100 <mauke> 0o (pronounced "uh-oh")
2025-12-04 19:56:35 +0100 <monochrom> heh
2025-12-04 19:56:19 +0100 <c_wraith> I found myself looking for how to write octal literals for the first time today. after almost 20 years using Haskell.
2025-12-04 19:56:09 +0100tromp(~textual@2001:1c00:3487:1b00:a4ed:9e46:fd5d:6b4e) (Client Quit)
2025-12-04 19:55:31 +0100 <monochrom> You can write your own Trifunctor class. If you subclass from Bifunctor, then you just have to add the third method. :)
2025-12-04 19:55:13 +0100tromp(~textual@2001:1c00:3487:1b00:a4ed:9e46:fd5d:6b4e)
2025-12-04 19:52:23 +0100 <monochrom> Yeah you want to avoid `n-1`.
2025-12-04 19:52:11 +0100 <Square2> Anyone know of a better trick?
2025-12-04 19:51:41 +0100 <Square2> first/second from Bifunctor is great for tuples. I ended up with a tuple-3 and tried to find something similar but the only thing I foudn was https://hackage.haskell.org/package/n-ary-functor-1.0 which felt a bit clumsy
2025-12-04 19:51:29 +0100 <mauke> maybe its implementation needs to be revised: upto n = takeWhile (< n) [0 ..]
2025-12-04 19:50:21 +0100 <mauke> "upto" is the kind of [0..n)
2025-12-04 19:49:37 +0100 <monochrom> Oh, I revise history all the time. >:)
2025-12-04 19:48:34 +0100 <int-e> I just don't think your explanation why `length` doesn't return Word is supported by history.
2025-12-04 19:48:34 +0100 <monochrom> I don't get the point.
2025-12-04 19:48:06 +0100 <int-e> monochrom: I know, and you missed the point :-P
2025-12-04 19:47:52 +0100 <monochrom> Word is in Data.Word
2025-12-04 19:47:38 +0100 <haskellbridge> <Zemyla> filter (/= n) [0..n]
2025-12-04 19:47:32 +0100 <int-e> monochrom: what is this "Word" you're talking about? https://www.haskell.org/onlinereport/basic.html#sect6.4
2025-12-04 19:47:07 +0100 <monochrom> Err, [0 .. (n :: Word) - 1] and [0 .. (n :: Natural) - 1] are foot guns.
2025-12-04 19:47:07 +0100fp(~Thunderbi@89-27-10-140.bb.dnainternet.fi) fp
2025-12-04 19:46:45 +0100 <monochrom> Because [0 .. (n :: Int) - 1] and [0 .. (n :: Integer) - 1] are foot guns.
2025-12-04 19:46:10 +0100 <mauke> why?
2025-12-04 19:45:56 +0100Googulator(~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu) (Quit: Client closed)
2025-12-04 19:45:56 +0100 <monochrom> If you take the position that length should have an unsigned type, then you must logically take the position that we need some kind of [0..n)
2025-12-04 19:45:51 +0100Googulator15(~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu)
2025-12-04 19:43:54 +0100 <monochrom> [0 .. n-1] is why, for example, length :: ... -> Int instead of Word
2025-12-04 19:41:39 +0100 <mauke> upto n = [0 .. n-1]
2025-12-04 19:41:12 +0100 <haskellbridge> <loonycyborg> as in C
2025-12-04 19:39:41 +0100tromp(~textual@2001:1c00:3487:1b00:a4ed:9e46:fd5d:6b4e) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-12-04 19:39:06 +0100 <haskellbridge> <loonycyborg> unless you're using record syntax, then they're mostly same :P
2025-12-04 19:38:43 +0100 <haskellbridge> <loonycyborg> In particular the "data" declaration, it can both replace C enum and C struct while being simpler conceptually.
2025-12-04 19:37:13 +0100euphores(~SASL_euph@user/euphores) (Ping timeout: 264 seconds)
2025-12-04 19:35:55 +0100annamalai(~annamalai@117.246.122.240) annamalai
2025-12-04 19:35:34 +0100annamalai(~annamalai@157.32.218.49) (Ping timeout: 260 seconds)
2025-12-04 19:33:28 +0100 <haskellbridge> <loonycyborg> Haskell's notation is on the simpler side actually. Even compared to C I'd say.
2025-12-04 19:31:49 +0100haritz(~hrtz@user/haritz) haritz
2025-12-04 19:31:49 +0100haritz(~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8) (Changing host)
2025-12-04 19:31:49 +0100haritz(~hrtz@2a01:4b00:bc2e:7000:d5af:a266:ca31:5ef8)
2025-12-04 19:30:58 +0100 <int-e> tomsmeding: Rust has the distinction but uses .. (exclusive) and ..= (inclusive). I know a languaage (LPC) that uses ..< but there ranges are inclusive and the < means "index from the end of the array". :-P