2024/05/10

Newest at the top

2024-05-10 22:22:24 +0200 <monochrom> I know nothing about FRACTRAN. I also don't know what input led to the space growth you saw. But perhaps you really ran into a really big number.
2024-05-10 22:18:59 +0200 <talismanick> I feel like I'm missing something...
2024-05-10 22:18:38 +0200 <talismanick> It terminates with Int instead of Integer, but, of course, returns the wrong answer due to overflow
2024-05-10 22:18:28 +0200justsomeguy(~justsomeg@user/justsomeguy)
2024-05-10 22:17:56 +0200 <talismanick> aren't kicking in*
2024-05-10 22:17:47 +0200 <talismanick> I thought list fusion plus taking the first integer and bailing would help, but either it's not enough or the optimizations aren't kicking
2024-05-10 22:17:26 +0200demon-cat(~demon-cat@dund-15-b2-v4wan-169642-cust1347.vm6.cable.virginm.net)
2024-05-10 22:16:57 +0200 <talismanick> it survived a bit longer when I forced it to compile with -O2, but ran into the same problem
2024-05-10 22:15:36 +0200 <talismanick> the memory usage climbs up a bit, falls back down, and then jumps up a gigabyte, repeating several times until I run out before computing the 7th Fibonacci (as is the traditional FRACTRAN test program)
2024-05-10 22:14:43 +0200 <talismanick> My thinking was that it should kill most of the shortlived `map (fromInteger n *)` lists in the nursery and eventually spit out an answer, but that seems to have been wrong
2024-05-10 22:13:59 +0200 <ncf> hence List a = 1 / (1 - a)
2024-05-10 22:13:44 +0200 <talismanick> https://0x0.st/X8Uj.txt
2024-05-10 22:13:43 +0200 <ncf> staying in the monoidal category Hask, we have List a = 1 + a + a² + ..., and List a = 1 + a * List a
2024-05-10 22:13:40 +0200 <talismanick> shoving the standard imperative FRACTRAN implementation into State should work (right?), but I decided to purify a trivial recursive translation to see how Haskell would handle it
2024-05-10 22:13:33 +0200 <ski> "This Week's Finds in Mathematical Physics (Week 202)" by John Baez in 2004-02-21 at <http://math.ucr.edu/home/baez/week202.html>
2024-05-10 22:13:30 +0200 <ski> "Objects of Categories as Complex Numbers" by Marcelo Fiore,Tom Leinster in 2002-12-30 at <https://arxiv.org/abs/math/0212377>
2024-05-10 22:13:23 +0200 <ski> "Seven Trees in One" by Andreas Blass in 1995 at <https://dept.math.lsa.umich.edu/~ablass/cat.html>,<https://dept.math.lsa.umich.edu/~ablass/7trees.pdf>,cf. <https://golem.ph.utexas.edu/category/2009/07/searching_for_a_video_proof_of.html>
2024-05-10 22:13:10 +0200 <ncf> oooh right what i was remembering is that you can actually make sense of 1/(1-f) for lists
2024-05-10 22:08:08 +0200 <ski> ∃ n : ℕ. fⁿ
2024-05-10 22:07:06 +0200 <[exa]> (other than that just a sum of geometric series. Funnily the type will be finite exactly if f<1.)
2024-05-10 22:05:15 +0200 <[exa]> also similar thing happens if you calculate products with vandermonde matrices, with less ugly calculus in the way
2024-05-10 22:02:56 +0200 <[exa]> (now we can try to geek it and invent negation in ADTs so that this generates well)
2024-05-10 22:02:06 +0200 <[exa]> ncf: looks like (1-f)^{-1} via maclaurin series
2024-05-10 22:01:02 +0200 <ncf> sum of the geometric series
2024-05-10 22:00:30 +0200 <ncf> what is this even called in math
2024-05-10 22:00:13 +0200 <ncf> but it seems too simple to not have a name of its own
2024-05-10 21:59:51 +0200 <ncf> then you have 1 + f (1 + f (1 + ...)) = 1 + f + ff + ...
2024-05-10 21:59:32 +0200 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
2024-05-10 21:59:32 +0200 <lambdabot> <hint>:1:26: error:
2024-05-10 21:59:31 +0200 <ncf> > if f preserves coproducts
2024-05-10 21:59:19 +0200 <probie> It's not quite a free monad, because all "branches" have the same depth, whilst a free monad doesn't have that restriction
2024-05-10 21:59:15 +0200 <ncf> or maybe yes
2024-05-10 21:58:52 +0200 <ncf> er no nvm
2024-05-10 21:57:37 +0200 <ncf> anyone know what this thing is called? it's the free monad on f if f preserves coproducts i guess
2024-05-10 21:57:24 +0200 <ncf> <ncf> 1 + f + f² + ...
2024-05-10 21:57:21 +0200 <tram> I think I have a good solution for problem 2 in H-99 (https://wiki.haskell.org/H-99:_Ninety-Nine_Haskell_Problems). I think it's faster than the ones on the wiki (at least the ones that are not cheating by using built in functions...)
2024-05-10 21:55:22 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 268 seconds)
2024-05-10 21:53:32 +0200 <[exa]> justsomeguy: optparse-applicative and gogogo
2024-05-10 21:50:38 +0200euphores(~SASL_euph@user/euphores) (Quit: Leaving.)
2024-05-10 21:45:05 +0200 <probie> I see a lot of the younger generation rather enamoured with Typst right now
2024-05-10 21:41:12 +0200 <monochrom> We all learned latex for school. :)
2024-05-10 21:38:24 +0200 <justsomeguy> (I actually have to learn latex for school.)
2024-05-10 21:38:22 +0200Henson(~kvirc@192-0-202-2.cpe.teksavvy.com) (Quit: KVIrc 5.0.1 Aria http://www.kvirc.net/)
2024-05-10 21:38:14 +0200philopsos1(~caecilius@user/philopsos)
2024-05-10 21:37:50 +0200 <justsomeguy> in latex :D
2024-05-10 21:33:27 +0200ocra8(ocra8@user/ocra8)
2024-05-10 21:32:33 +0200 <monochrom> or a PhD thesis >:)
2024-05-10 21:31:38 +0200 <dolio> Probably.
2024-05-10 21:31:06 +0200 <justsomeguy> ^_^;...
2024-05-10 21:30:52 +0200 <justsomeguy> So, I've finally gotten through the basics of Semigroup, Monoid, Functor, Foldable, Applicative and Monad. Can I write cool command-line apps now?