2025/12/04

Newest at the top

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
2025-12-04 19:22:39 +0100deptype(~deptype@2406:b400:3a:9d2f:cc6c:ad35:cfc6:21bb)
2025-12-04 19:21:07 +0100 <__monty__> Hmm, `hylo` still requires passing in `fold` and `unfoldr (...)` I guess. It's also a lot slower than just `fold . unfoldr (...)` in my case for some reason.
2025-12-04 19:18:52 +0100Square2(~Square4@user/square) Square
2025-12-04 19:09:25 +0100ft(~ft@p508db844.dip0.t-ipconnect.de) ft
2025-12-04 19:08:18 +0100wickedjargon(~user@207.194.126.4) (Remote host closed the connection)
2025-12-04 19:08:01 +0100lambda_gibbon(~lambda_gi@208.83.175.39)
2025-12-04 19:03:13 +0100sindu(~sindu@2.148.32.207.tmi.telenormobil.no)
2025-12-04 19:00:17 +0100target_i(~target_i@user/target-i/x-6023099) target_i
2025-12-04 18:48:07 +0100tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net) tzh
2025-12-04 18:47:53 +0100Googulator(~Googulato@2a01-036d-0106-479c-d9ec-010d-f188-ffcb.pool6.digikabel.hu)
2025-12-04 18:46:49 +0100Square2(~Square4@user/square) (Ping timeout: 264 seconds)
2025-12-04 18:38:56 +0100divlamir_divlamir
2025-12-04 18:38:55 +0100divlamir(~divlamir@user/divlamir) (Ping timeout: 240 seconds)
2025-12-04 18:35:47 +0100divlamir_(~divlamir@user/divlamir) divlamir
2025-12-04 18:34:05 +0100__monty_1__monty__
2025-12-04 18:34:00 +0100 <__monty_1> I find myself doing `fold . unfoldr` is there a combinator I'm missing that does this? My intuition from foldr->fold suggests unfold but none of those expects a Monoid constraint. Corecursive from recursion-schemes seems similar to Monoid maybe. So then it would be `hylo`?
2025-12-04 18:26:44 +0100kuribas(~user@ip-188-118-57-242.reverse.destiny.be) (Ping timeout: 260 seconds)