2022/09/28

2022-09-28 00:00:19 +0200bilegeek(~bilegeek@2600:1008:b058:58ea:bed4:5c49:4f66:54ee)
2022-09-28 00:03:27 +0200 <[exa]> (nvm I'm off, hopefully someone here will be able to provide better ideas about how to solve this :D )
2022-09-28 00:08:38 +0200zebrag(~chris@user/zebrag)
2022-09-28 00:08:39 +0200fef(~thedawn@user/thedawn) (Ping timeout: 258 seconds)
2022-09-28 00:11:47 +0200Midjak(~Midjak@82.66.147.146) (Quit: This computer has gone to sleep)
2022-09-28 00:18:22 +0200beteigeuze(~Thunderbi@2001:8a0:61b5:6101:f0c:e4e3:bfdc:91df)
2022-09-28 00:18:32 +0200ColereLoupGris
2022-09-28 00:20:32 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Ping timeout: 258 seconds)
2022-09-28 00:21:40 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-28 00:26:32 +0200 <ph88^> Total time 29.312s ( 14.528s elapsed) what's the difference between these two times here in the ghc stats ?
2022-09-28 00:28:55 +0200slac53815(~slack1256@186.11.109.251)
2022-09-28 00:29:43 +0200 <monochrom> I hypothesize that "elapsed time" means wallclock time, i.e., if you use a stop watch to measure the running time, it's going to be 14.528 seconds.
2022-09-28 00:29:57 +0200 <int-e> and the former counts running time across all threads
2022-09-28 00:30:05 +0200 <monochrom> I don't know whether I'm right or wrong, but now you can test my hypothesis.
2022-09-28 00:30:26 +0200 <int-e> (of which there appear to be two in this case)
2022-09-28 00:30:50 +0200 <monochrom> Whenever I teach a course, the department requires me to review TA applications to help select TAs.
2022-09-28 00:31:14 +0200slack1256(~slack1256@191.126.227.202) (Ping timeout: 265 seconds)
2022-09-28 00:31:23 +0200 <monochrom> The application form includes "how many hours would you like to work for?"
2022-09-28 00:31:57 +0200 <monochrom> The TA contract to be awarded is for 4 months, which is the length of one school term/semester here.
2022-09-28 00:32:15 +0200donato(uid570353@id-570353.ilkley.irccloud.com)
2022-09-28 00:32:39 +0200 <monochrom> So one time I received an application that states "I want to work for 10000 hours".
2022-09-28 00:32:46 +0200 <monochrom> So let's see:
2022-09-28 00:32:56 +0200 <monochrom> > 4*30*24
2022-09-28 00:32:58 +0200 <lambdabot> 2880
2022-09-28 00:33:20 +0200 <monochrom> So, how many cores does the applicant thinks they have in their brains? >:)
2022-09-28 00:34:16 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds)
2022-09-28 00:35:00 +0200 <dolio> A lot more than 4.
2022-09-28 00:35:05 +0200 <int-e> Well they probably have more than one brain cell.
2022-09-28 00:35:35 +0200 <int-e> . o O ( Also, work for 10 minutes, bill for an hour... isn't that how it goes? )
2022-09-28 00:37:37 +0200lyle(~lyle@104.246.145.85) (Ping timeout: 250 seconds)
2022-09-28 00:42:02 +0200rsm5560(~rsm5560@c-24-0-153-56.hsd1.nj.comcast.net)
2022-09-28 00:44:07 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-09-28 00:46:57 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 00:47:58 +0200 <darkling> I find it linguistically amusing that a semester is only four months, not the stated six. :)
2022-09-28 00:48:08 +0200 <rsm5560> Hi. a confused newby here.  I'm trying to use runghc and Shelly package, but can't even get the package recognized byt it.  I tryied the documented :runghc -package --ghc-arg=shelly -v  -- app/Main.hs
2022-09-28 00:48:08 +0200 <rsm5560> but get cannot satisfy -package shelly so I gather it isn't in package.conf.d but I don't know how to get it there?
2022-09-28 00:48:09 +0200 <rsm5560> I have it in listed as a build-dependency in the foo.cable file and ghc build didn't complain, but I'm totally confused
2022-09-28 00:48:09 +0200jespada(~jespada@77.97.36.250) (Quit: Textual IRC Client: www.textualapp.com)
2022-09-28 00:48:09 +0200 <rsm5560> any help?
2022-09-28 00:48:44 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-09-28 00:54:15 +0200 <geekosaur> does `cabal exec runghc app/Main.hs` work?
2022-09-28 00:54:55 +0200 <geekosaur> cabal no longer pollutes global package namespaces with possibly incompatible packages; you must go through it to access its packages
2022-09-28 00:55:03 +0200 <rsm5560> yes that works
2022-09-28 00:55:05 +0200 <geekosaur> unless you like dealing with conflicts manually
2022-09-28 00:56:03 +0200yobson_(~yobson@mail.jotron.com) (Ping timeout: 248 seconds)
2022-09-28 00:57:20 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-28 00:57:46 +0200 <rsm5560> I'm trying to find the most beginner friendly way to do things.  I quickly got into details of ghc and cabel and ghc-pkg that lost me.
2022-09-28 00:57:47 +0200 <rsm5560> any advice to a more detailed getting started documentation that doesn't got from hello-world to "understand everything" would be great for me
2022-09-28 00:58:02 +0200lyle(~lyle@104.246.145.85)
2022-09-28 00:58:16 +0200Tuplanolla(~Tuplanoll@91-159-69-34.elisa-laajakaista.fi) (Quit: Leaving.)
2022-09-28 00:58:26 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 00:59:34 +0200 <talismanick> https://0x0.st/o4on.txt
2022-09-28 01:00:32 +0200talismanickpounds table trying to get brittany to work
2022-09-28 01:01:54 +0200 <talismanick> `lsp-haskell-formatting-provider` (Elisp variable from lsp-haskell.el) is set to "brittany" and has "Ensure the plugin is enabled" at the end of the docstring, w/o how to do that
2022-09-28 01:02:42 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 01:03:00 +0200 <talismanick> Do I need to rebuild the language server with the brittany flag enabled?
2022-09-28 01:03:31 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 01:06:55 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 258 seconds)
2022-09-28 01:07:02 +0200rsm5560(~rsm5560@c-24-0-153-56.hsd1.nj.comcast.net) (Quit: Client closed)
2022-09-28 01:07:09 +0200yobson(~yobson@mail.jotron.com) (Read error: Connection reset by peer)
2022-09-28 01:07:13 +0200yobson__(~yobson@mail.jotron.com)
2022-09-28 01:08:42 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-09-28 01:08:42 +0200yobson__(~yobson@mail.jotron.com) (Read error: Connection reset by peer)
2022-09-28 01:08:42 +0200 <talismanick> What's weird is that it worked before
2022-09-28 01:08:45 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 01:08:46 +0200 <talismanick> so, no clue what changed
2022-09-28 01:09:00 +0200 <talismanick> (installed HLS via ghcup)
2022-09-28 01:11:30 +0200jespada(~jespada@cpc121060-nmal24-2-0-cust249.19-2.cable.virginm.net)
2022-09-28 01:13:15 +0200yobson(~yobson@mail.jotron.com) (Ping timeout: 252 seconds)
2022-09-28 01:13:54 +0200yobson_(~yobson@mail.jotron.com)
2022-09-28 01:20:24 +0200 <sm> @where HTAC
2022-09-28 01:20:25 +0200 <sm> is one I like, rsm5560
2022-09-28 01:20:25 +0200 <lambdabot> "Haskell Tutorial and Cookbook" by Mark Watson in 2017-09-04 at <https://leanpub.com/haskell-cookbook>
2022-09-28 01:21:43 +0200 <sm> the current best getting started doc using cabal only is: ...
2022-09-28 01:23:42 +0200jmorris(uid537181@id-537181.uxbridge.irccloud.com)
2022-09-28 01:24:04 +0200 <zzz> record update is infixr?
2022-09-28 01:24:40 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-09-28 01:26:12 +0200bontaq(~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 264 seconds)
2022-09-28 01:27:34 +0200 <sm> ... https://cabal.readthedocs.io/en/stable/getting-started.html I suspect
2022-09-28 01:30:48 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-09-28 01:34:24 +0200bgs(~bgs@212-85-160-171.dynamic.telemach.net)
2022-09-28 01:36:23 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com)
2022-09-28 01:36:24 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
2022-09-28 01:36:24 +0200wroathe(~wroathe@user/wroathe)
2022-09-28 01:39:01 +0200pieguy128(~pieguy128@bras-base-mtrlpq5031w-grc-50-65-93-192-212.dsl.bell.ca) (Ping timeout: 268 seconds)
2022-09-28 01:40:10 +0200pieguy128(~pieguy128@bras-base-mtrlpq5031w-grc-50-65-93-192-212.dsl.bell.ca)
2022-09-28 01:42:14 +0200 <alexfmpe[m]> is the effect of adding an unpack pragma equivalent to "use this as if it was a newtype" ?
2022-09-28 01:42:35 +0200redmp(~redmp@mobile-166-177-251-115.mycingular.net)
2022-09-28 01:42:45 +0200notzmv(~zmv@user/notzmv)
2022-09-28 01:44:20 +0200 <geekosaur> no, because it has an actual constructor still. it's the contained field that no longer has one (and you need an unpack per unpackable field)
2022-09-28 01:45:54 +0200 <alexfmpe[m]> I meant "use the unpacked type here as if it had been declared as a newtype"
2022-09-28 01:47:03 +0200mmhat(~mmh@p200300f1c7062304ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.6)
2022-09-28 01:50:50 +0200 <geekosaur> it does more than that. newtype avoids adding a level of indirection; UNPACK removes a level of indirection
2022-09-28 01:52:08 +0200 <geekosaur> in particular, the UNPACKed field must be strict, have one constructor (since there is no constructor tag), and have a known size since it will be stored directly in the record. this is a tighter constraint than on newtypes
2022-09-28 01:52:34 +0200lyle(~lyle@104.246.145.85) (Ping timeout: 268 seconds)
2022-09-28 01:56:15 +0200mud(~mud@user/kadoban)
2022-09-28 01:57:46 +0200zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2022-09-28 02:03:29 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-28 02:04:14 +0200 <ski> zzz : it's `infixl'
2022-09-28 02:04:54 +0200 <ski> > Node {rootLabel = (),subForest = []} {subForest = [Node {rootLabel = (),subForest = []}]}
2022-09-28 02:04:56 +0200 <lambdabot> Node {rootLabel = (), subForest = [Node {rootLabel = (), subForest = []}]}
2022-09-28 02:05:54 +0200 <ski> > Node {rootLabel = (),subForest = []} {subForest = [Node {rootLabel = (),subForest = []}]} {subForest = []} -- in case you wanted to actually have two updates, and not just a construction and an update
2022-09-28 02:05:55 +0200 <lambdabot> Node {rootLabel = (), subForest = []}
2022-09-28 02:07:57 +0200 <ski> > let Node {rootLabel = r,..} {subForest = f} = Node {rootLabel = r,subForest = []} in (r,f)
2022-09-28 02:07:59 +0200 <lambdabot> <hint>:1:5: error:
2022-09-28 02:07:59 +0200 <lambdabot> Not a record constructor: Node {rootLabel = r, ..}
2022-09-28 02:08:00 +0200 <ski> > let f Node {rootLabel = r,..} {subForest = f} = (r,f) in f Node {rootLabel = r,subForest = []}
2022-09-28 02:08:02 +0200 <lambdabot> <hint>:1:7: error:
2022-09-28 02:08:02 +0200 <lambdabot> Not a record constructor: Node {rootLabel = r, ..}
2022-09-28 02:08:08 +0200 <ski> no update syntax in patterns, though ^
2022-09-28 02:08:47 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 02:09:14 +0200 <ski> data Tree a = Node {rootLabel :: a,subForest :: [Tree a]} -- for completeness
2022-09-28 02:10:33 +0200 <talismanick> Let's say O
2022-09-28 02:11:07 +0200 <talismanick> I'm writing a program which writes to files (assume POSIX fs for simplicity) but only appending or creating
2022-09-28 02:11:17 +0200 <talismanick> let's say I'm writing*
2022-09-28 02:11:53 +0200 <talismanick> Is there a more modular library than Turtle, Shelly, etc which gives me atomicity guarantees?
2022-09-28 02:12:44 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2022-09-28 02:13:32 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-09-28 02:13:56 +0200 <talismanick> or, is persistent STM (PSTM) already usable?
2022-09-28 02:18:58 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection)
2022-09-28 02:20:26 +0200yobson_(~yobson@mail.jotron.com) (Ping timeout: 260 seconds)
2022-09-28 02:20:28 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 02:21:33 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-09-28 02:23:48 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 264 seconds)
2022-09-28 02:24:49 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 265 seconds)
2022-09-28 02:28:47 +0200redmp(~redmp@mobile-166-177-251-115.mycingular.net) (Ping timeout: 252 seconds)
2022-09-28 02:31:27 +0200zmt01(~zmt00@user/zmt00)
2022-09-28 02:31:40 +0200 <ski> somewhat apropos "who gives answers most quickly","If you don't get an answer in 2 minutes, the forum is dead." : "Why I no longer contribute to StackOverflow" by ttmrichter in 2013-12 at <https://web.archive.org/web/20140104210553/http://michael.richter.name/blogs/why-i-no-longer-contr…>
2022-09-28 02:31:55 +0200zmt00(~zmt00@user/zmt00) (Ping timeout: 244 seconds)
2022-09-28 02:32:05 +0200 <ski> <monochrom> Hell, how did Prolog name something "functor" and have it not be related to functor >:) <monochrom> s/Prolog/the Prolog people/ <geekosaur> or s/Prolog/C++/
2022-09-28 02:32:11 +0200 <ski> @where on-functors
2022-09-28 02:32:12 +0200 <lambdabot> "On Functors" (in C++,Standard ML,Haskell,Prolog) by Peteris Krumins in 2010-05-17 at <http://www.catonmat.net/blog/on-functors/>
2022-09-28 02:32:23 +0200 <sm> dumb answer: creating/appending are just naturally atomic ?talismanick
2022-09-28 02:32:31 +0200yobson_(~yobson@mail.jotron.com)
2022-09-28 02:32:56 +0200 <ski> iirc Prolog got the word from symbolic logic, which got the name from philosophy (like Carnap)
2022-09-28 02:33:25 +0200 <ski> talismanick : btw, you've heard that uniqueness is sortof the opposite of linearity, yes ?
2022-09-28 02:34:14 +0200 <talismanick> ski: As a matter of fact, I do feel like I've read that somewhere
2022-09-28 02:34:41 +0200 <talismanick> but, if I'm being honest, it's as well as if I hadn't, because I'm not sure I understand
2022-09-28 02:35:20 +0200 <ski> a linear reference can't be duplicated (or discarded) in the future, but may have been duplicated in the past (before derelicting it (promoting to linear from unrestricted))
2022-09-28 02:36:03 +0200 <ski> while a unique reference hasn't been duplicated in the past (so update-in-place is safe on it), while it may be duplicated (and discarded) in the future
2022-09-28 02:37:04 +0200yobson_(~yobson@mail.jotron.com) (Ping timeout: 244 seconds)
2022-09-28 02:37:21 +0200 <talismanick> ski: it can be duplicated/discarded in the future?
2022-09-28 02:37:31 +0200 <ski> yes
2022-09-28 02:37:34 +0200 <ski> however
2022-09-28 02:38:03 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 02:38:26 +0200 <ski> if you have an interface giving you a unique reference, and requiring you to return back a unique reference (and you have no other way to conjure up a unique reference of the same type), then you can't duplicate (or discard), since you must return a unique reference
2022-09-28 02:38:26 +0200 <talismanick> Is there a transformation which takes it from unique to regular, dual to the transformation which takes regular to linear?
2022-09-28 02:38:54 +0200 <talismanick> ah, I see
2022-09-28 02:39:39 +0200 <talismanick> what goes in, must come out if you pull something out and there isn't anything else
2022-09-28 02:39:51 +0200 <ski> this is how `Start :: *World -> *World' in Clean works. also `:- mode main(io.state :: unique >> dead,io.state :: free >> unique).' (iirc) in Mercury
2022-09-28 02:40:28 +0200 <talismanick> Yeah, !IO is sugar for IO1,IO2 in one side-effecting call, then IO2, IO3 in the next
2022-09-28 02:40:45 +0200 <talismanick> and the top level is IO1, IOn in the head
2022-09-28 02:40:46 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-09-28 02:41:00 +0200 <ski> well, yes, you can use the state-variable notation (or DCG notation). that's orthogonal to the typing aspects, though
2022-09-28 02:41:05 +0200 <talismanick> IO0, if we're using the same number scheme
2022-09-28 02:41:10 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-28 02:42:49 +0200 <EvanR> realworld is deeply magical. It is primitive but it is not unlifted
2022-09-28 02:43:58 +0200 <talismanick> Hm, looked it up and found https://granule-project.github.io/papers/esop22-paper.pdf
2022-09-28 02:44:08 +0200 <talismanick> Another paper on the "to read" heap
2022-09-28 02:44:58 +0200 <ski> state-variable notation <https://www.mercurylang.org/information/doc-latest/mercury_ref/Clauses.html#State-variables>,DCG <https://www.mercurylang.org/information/doc-latest/mercury_ref/Clauses.html#Definite-clause-grammars>
2022-09-28 02:46:38 +0200 <ski> (iirc, there was some example in the Linear Haskell paper which indicated a way to simulate uniqueness with linearity, at least for a particular application. with CPS, iirc)
2022-09-28 02:47:17 +0200 <talismanick> ski: "the" Linear Haskell paper?
2022-09-28 02:47:48 +0200 <talismanick> Am actually a bit lost on which one is a canonical reference for what exists now
2022-09-28 02:48:57 +0200 <ski> i only have a vague recollection of something like that, may be misremembering, or misrepresenting the scope of it
2022-09-28 02:49:20 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 02:57:13 +0200cyphase(~cyphase@user/cyphase) (Ping timeout: 244 seconds)
2022-09-28 03:00:09 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-09-28 03:00:31 +0200 <ski> (hm, i think part of what it was i was inferring from things it, thinking about it, not just something spelled out in detail)
2022-09-28 03:02:05 +0200cyphase(~cyphase@user/cyphase)
2022-09-28 03:08:23 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
2022-09-28 03:08:23 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2022-09-28 03:11:58 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-09-28 03:12:04 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 03:22:42 +0200xff0x(~xff0x@2405:6580:b080:900:a11c:672e:e426:9fe0) (Ping timeout: 268 seconds)
2022-09-28 03:31:11 +0200nate3(~nate@98.45.169.16)
2022-09-28 03:34:31 +0200beteigeuze(~Thunderbi@2001:8a0:61b5:6101:f0c:e4e3:bfdc:91df) (Ping timeout: 260 seconds)
2022-09-28 03:34:48 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-09-28 03:35:53 +0200nate3(~nate@98.45.169.16) (Ping timeout: 252 seconds)
2022-09-28 03:36:29 +0200waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 244 seconds)
2022-09-28 03:42:42 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 03:47:21 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-28 03:52:33 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 03:53:12 +0200yobson(~yobson@mail.jotron.com) (Ping timeout: 264 seconds)
2022-09-28 03:55:12 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 265 seconds)
2022-09-28 04:05:07 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 04:07:51 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 258 seconds)
2022-09-28 04:08:36 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-09-28 04:08:48 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
2022-09-28 04:09:39 +0200yobson(~yobson@mail.jotron.com) (Ping timeout: 248 seconds)
2022-09-28 04:15:59 +0200td_(~td@muedsl-82-207-238-071.citykom.de) (Ping timeout: 265 seconds)
2022-09-28 04:17:34 +0200td_(~td@muedsl-82-207-238-028.citykom.de)
2022-09-28 04:20:33 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2022-09-28 04:22:19 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 04:23:25 +0200jmorris(uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2022-09-28 04:26:25 +0200dcoutts__(~duncan@host86-177-125-45.range86-177.btcentralplus.com)
2022-09-28 04:26:26 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 04:26:48 +0200yobson(~yobson@mail.jotron.com) (Ping timeout: 264 seconds)
2022-09-28 04:27:13 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 04:28:40 +0200dcoutts_(~duncan@host86-151-44-255.range86-151.btcentralplus.com) (Ping timeout: 244 seconds)
2022-09-28 04:32:00 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 258 seconds)
2022-09-28 04:34:18 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-09-28 04:38:05 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-28 04:39:53 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 04:43:14 +0200nate3(~nate@98.45.169.16)
2022-09-28 04:43:38 +0200dolio(~dolio@130.44.130.54) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-28 04:46:41 +0200dolio(~dolio@130.44.130.54)
2022-09-28 04:47:02 +0200dolio(~dolio@130.44.130.54) (Remote host closed the connection)
2022-09-28 04:48:26 +0200mzan(~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-09-28 04:48:45 +0200dolio(~dolio@130.44.130.54)
2022-09-28 04:48:56 +0200mvk(~mvk@2607:fea8:5ce3:8500::778c) (Ping timeout: 268 seconds)
2022-09-28 04:49:29 +0200mzan(~quassel@mail.asterisell.com)
2022-09-28 04:51:55 +0200rburkholder(~blurb@96.45.2.121)
2022-09-28 04:53:02 +0200luffy(~chenqisu1@183.217.201.156)
2022-09-28 04:58:38 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Read error: Connection timed out)
2022-09-28 05:06:02 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 05:12:57 +0200jero98772(~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) (Remote host closed the connection)
2022-09-28 05:24:15 +0200frost(~frost@user/frost)
2022-09-28 05:28:52 +0200slac53815(~slack1256@186.11.109.251) (Ping timeout: 246 seconds)
2022-09-28 05:37:06 +0200nate3(~nate@98.45.169.16) (Ping timeout: 268 seconds)
2022-09-28 05:44:06 +0200yobson(~yobson@mail.jotron.com) (Ping timeout: 244 seconds)
2022-09-28 05:45:44 +0200Vajb(~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57) (Read error: Connection reset by peer)
2022-09-28 05:46:03 +0200Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
2022-09-28 05:51:57 +0200Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-09-28 05:52:10 +0200Vajb(~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57)
2022-09-28 05:53:23 +0200luffy(~chenqisu1@183.217.201.156) (Ping timeout: 252 seconds)
2022-09-28 05:54:29 +0200bilegeek(~bilegeek@2600:1008:b058:58ea:bed4:5c49:4f66:54ee) (Quit: Leaving)
2022-09-28 05:54:38 +0200frost(~frost@user/frost) (Quit: Ping timeout (120 seconds))
2022-09-28 05:55:45 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 06:00:24 +0200yobson(~yobson@mail.jotron.com) (Ping timeout: 265 seconds)
2022-09-28 06:00:38 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
2022-09-28 06:04:10 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 06:11:56 +0200yobson_(~yobson@mail.jotron.com)
2022-09-28 06:18:58 +0200nate3(~nate@98.45.169.16)
2022-09-28 06:19:25 +0200yobson_(~yobson@mail.jotron.com) (Ping timeout: 252 seconds)
2022-09-28 06:19:57 +0200yobson_(~yobson@mail.jotron.com)
2022-09-28 06:21:57 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 06:23:10 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Ping timeout: 258 seconds)
2022-09-28 06:24:33 +0200yobson_(~yobson@mail.jotron.com) (Ping timeout: 265 seconds)
2022-09-28 06:26:36 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 260 seconds)
2022-09-28 06:27:27 +0200nate3(~nate@98.45.169.16) (Ping timeout: 265 seconds)
2022-09-28 06:27:34 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-09-28 06:36:00 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 06:40:19 +0200yobson(~yobson@mail.jotron.com) (Ping timeout: 252 seconds)
2022-09-28 06:44:02 +0200bgs(~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
2022-09-28 06:46:09 +0200dontdieych(~quassel@146.56.130.54)
2022-09-28 06:52:15 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 07:03:15 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection)
2022-09-28 07:07:26 +0200matthewmosior(~matthewmo@173.170.253.91) (Ping timeout: 260 seconds)
2022-09-28 07:09:52 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 07:10:46 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-09-28 07:19:13 +0200remexre(~remexre@user/remexre) (Remote host closed the connection)
2022-09-28 07:19:16 +0200matthewmosior(~matthewmo@173.170.253.91) (Remote host closed the connection)
2022-09-28 07:19:22 +0200matthewmosior(~matthewmo@173.170.253.91)
2022-09-28 07:19:51 +0200matthewmosior(~matthewmo@173.170.253.91) (Client Quit)
2022-09-28 07:19:56 +0200gmg(~user@user/gehmehgeh)
2022-09-28 07:20:35 +0200remexre(~remexre@user/remexre)
2022-09-28 07:28:54 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection)
2022-09-28 07:30:21 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-09-28 07:34:00 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2022-09-28 07:38:15 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds)
2022-09-28 07:41:13 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-09-28 07:42:10 +0200gmg(~user@user/gehmehgeh)
2022-09-28 07:43:52 +0200chexum_(~quassel@gateway/tor-sasl/chexum)
2022-09-28 07:44:49 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Ping timeout: 258 seconds)
2022-09-28 07:57:24 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-09-28 07:58:24 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2022-09-28 07:59:09 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Client Quit)
2022-09-28 07:59:12 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2022-09-28 08:00:54 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-09-28 08:07:18 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2022-09-28 08:07:57 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-09-28 08:10:00 +0200cyphase(~cyphase@user/cyphase) (Ping timeout: 264 seconds)
2022-09-28 08:12:31 +0200yobson(~yobson@mail.jotron.com) (Remote host closed the connection)
2022-09-28 08:12:43 +0200yobson(~yobson@mail.jotron.com)
2022-09-28 08:14:30 +0200cyphase(~cyphase@user/cyphase)
2022-09-28 08:14:53 +0200kenran(~user@user/kenran)
2022-09-28 08:16:45 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 252 seconds)
2022-09-28 08:19:18 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 08:21:07 +0200lottaquestions(~nick@2607:fa49:503e:7100:fd11:b240:caa3:7177)
2022-09-28 08:22:43 +0200lottaquestions_(~nick@2607:fa49:503e:7100:7430:a788:fee1:3622) (Ping timeout: 244 seconds)
2022-09-28 08:24:03 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 248 seconds)
2022-09-28 08:27:23 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 08:29:54 +0200michalz(~michalz@185.246.207.215)
2022-09-28 08:34:53 +0200zeenk(~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f)
2022-09-28 08:46:42 +0200chexum_(~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
2022-09-28 08:48:13 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-28 08:48:53 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Remote host closed the connection)
2022-09-28 08:49:25 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-09-28 08:53:13 +0200Sose(~sose@mobile-access-567367-206.dhcp.inet.fi)
2022-09-28 08:54:08 +0200 <phma> https://hackage.haskell.org/package/random-ladder-0.1.0.0/candidate
2022-09-28 08:54:15 +0200QNXEnchanterTim
2022-09-28 08:54:30 +0200 <phma> this is my first package candidate. could someone look at it?
2022-09-28 08:54:59 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 08:55:17 +0200titibandit(~titibandi@xdsl-212-8-150-57.nc.de)
2022-09-28 08:56:20 +0200perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Ping timeout: 265 seconds)
2022-09-28 08:57:50 +0200perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
2022-09-28 08:59:22 +0200jargon(~jargon@184.101.186.15) (Remote host closed the connection)
2022-09-28 09:03:04 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds)
2022-09-28 09:03:32 +0200david(~david@2a01:e34:ec2b:d430:44a:f5ca:9867:d69d) (Read error: Connection reset by peer)
2022-09-28 09:15:49 +0200jonathanx(~jonathan@h-98-128-168-222.NA.cust.bahnhof.se)
2022-09-28 09:16:31 +0200fserucas(~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7)
2022-09-28 09:16:48 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-09-28 09:17:16 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:445e:b42c:e761:f5db)
2022-09-28 09:21:48 +0200MajorBiscuit(~MajorBisc@2a02-a461-129d-1-193d-75d8-745d-e91e.fixed6.kpn.net)
2022-09-28 09:23:10 +0200jargon(~jargon@184.101.186.15)
2022-09-28 09:30:21 +0200nate3(~nate@98.45.169.16)
2022-09-28 09:30:30 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-09-28 09:31:26 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 244 seconds)
2022-09-28 09:32:01 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 09:32:11 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-28 09:32:29 +0200chomwitt(~chomwitt@2a02:587:dc14:f500:278:be15:4a20:8304)
2022-09-28 09:33:24 +0200notzmv(~zmv@user/notzmv) (Ping timeout: 264 seconds)
2022-09-28 09:35:28 +0200nate3(~nate@98.45.169.16) (Ping timeout: 265 seconds)
2022-09-28 09:36:06 +0200ubert(~Thunderbi@77.119.161.212.wireless.dyn.drei.com)
2022-09-28 09:38:02 +0200acidjnk(~acidjnk@p200300d6e7137a1628fe4ecf7cec9dba.dip0.t-ipconnect.de)
2022-09-28 09:43:46 +0200 <pavonia> Looks interesting (though I have no idea how it works)
2022-09-28 09:47:34 +0200yobson(~yobson@mail.jotron.com) (Quit: Leaving...)
2022-09-28 09:47:58 +0200 <dminuoso> Favourite newtype of the day: newtype DList a = DList { unDList :: [a] -> [a] }
2022-09-28 09:50:00 +0200 <dminuoso> phma: I would start with the false assumption that lazyness is the reason you cannot do constant (you wrongly wrote equal by the way) time elliptic curve multiplication.
2022-09-28 09:52:18 +0200beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-09-28 09:52:43 +0200 <dminuoso> Because at the end, you *can* get all strictness that you want. A much bigger problem is a) the simplifier retransforming your code into a non-conforming implementation (i.e. montgomery ladder might be twisted around, inlined and let-floated to the point that all constant time guarantees are wrojng), and b) you need to tightly control or prevent caching
2022-09-28 09:53:06 +0200Major_Biscuit(~MajorBisc@c-001-023-044.client.tudelft.eduvpn.nl)
2022-09-28 09:53:25 +0200 <dminuoso> I do not think there exists a pragma to transitively say "do not simplify this code transitively"
2022-09-28 09:54:06 +0200 <dminuoso> Honestly, a more pragmatic solution to doing cryptographic computation, is to FFI into an established and peer reviewed C library
2022-09-28 09:54:07 +0200frost(~frost@user/frost)
2022-09-28 09:54:39 +0200 <dminuoso> e.g. using OpenSSL EC
2022-09-28 09:56:19 +0200MajorBiscuit(~MajorBisc@2a02-a461-129d-1-193d-75d8-745d-e91e.fixed6.kpn.net) (Ping timeout: 248 seconds)
2022-09-28 09:56:36 +0200 <phma> What do you mean by "let-floated"?
2022-09-28 09:56:39 +0200 <dminuoso> Besides, judging from a skim at your code I do not think you will benefit from "random guarantees"
2022-09-28 09:57:15 +0200ay(Andrew@user/AndrewYu) (WeeChat 3.7-dev)
2022-09-28 09:58:00 +0200machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2022-09-28 09:58:04 +0200 <dminuoso> phma: a let-binding can sometimes be moved around into or out of things
2022-09-28 09:58:21 +0200 <dminuoso> This can facilitate extra sharing or inlining
2022-09-28 09:58:58 +0200 <dminuoso> Your biggest enemy in cryptographic computation is compiler optimizations and hardware accelerations (non-constant machine instructions and caching)
2022-09-28 09:59:04 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-09-28 09:59:04 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-09-28 09:59:15 +0200 <dminuoso> (That is, if you use an established constant-time algorithm to begin with)
2022-09-28 09:59:32 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-28 09:59:32 +0200 <dminuoso> (Oh, and things like super scalar execution are nightmarish too)
2022-09-28 09:59:48 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-09-28 10:00:11 +0200 <dminuoso> phma: and by the way, I do not think your implementation is really "random". its computation behavior is deterministic.
2022-09-28 10:00:29 +0200 <dminuoso> I would like to see a peer-reviewed publication on your strategry.
2022-09-28 10:00:29 +0200 <phma> the random number comes from outside
2022-09-28 10:03:16 +0200 <dminuoso> phma: fair enough, but even the rest of the implementation should be looked at very closely.
2022-09-28 10:03:33 +0200 <dminuoso> i.e. does this leak secrets into CPU cache?
2022-09-28 10:03:41 +0200 <phma> The argument "random" to randomLadder should be picked at random. It determines the order of operations, without affecting the result.
2022-09-28 10:06:08 +0200Sose(~sose@mobile-access-567367-206.dhcp.inet.fi) (Quit: Leaving)
2022-09-28 10:06:10 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-28 10:12:43 +0200jargon(~jargon@184.101.186.15) (Remote host closed the connection)
2022-09-28 10:13:46 +0200jmdaemon(~jmdaemon@user/jmdaemon) (Ping timeout: 246 seconds)
2022-09-28 10:14:20 +0200 <phma> dminuoso: I sent it to Sam Wagstaff. He likes it, though he doesn't know Haskell.
2022-09-28 10:15:28 +0200 <phma> I took his crypto class the first year he was at Purdue, replacing Dorothy Denning, who wrote the book.
2022-09-28 10:15:51 +0200shriekingnoise(~shrieking@186.137.167.202) (Quit: Quit)
2022-09-28 10:18:47 +0200 <phma> Montgomery wentletrap
2022-09-28 10:20:15 +0200 <[exa]> phma: the package is interesting but I thought that the common consensus in cryptography is that you can't really fight timing attacks with random delays
2022-09-28 10:26:47 +0200 <phma> it isn't introducing random delays, it's choosing a random sequence of operations that multiplies by the given number
2022-09-28 10:27:22 +0200 <dminuoso> The real concern is the ladder itself at the end.
2022-09-28 10:27:56 +0200 <dminuoso> After the simplifier is done, who is to say that you will be leaking bits out via timing *despite* a random ladder.
2022-09-28 10:28:05 +0200 <dminuoso> Or via cache
2022-09-28 10:29:18 +0200TonyStone(~TonyStone@2603-7080-8607-c36a-cc48-2eb7-9785-f03a.res6.spectrum.com) (Ping timeout: 244 seconds)
2022-09-28 10:31:07 +0200 <phma> How can I try a timing or cache attack on the random ladder?
2022-09-28 10:31:08 +0200waldo(~waldo@user/waldo)
2022-09-28 10:31:23 +0200 <dminuoso> By spending a lot of analysis on the generated core and machine code.
2022-09-28 10:31:59 +0200 <dminuoso> phma: The usual method is the Feynman algorithm.
2022-09-28 10:33:47 +0200 <phma> "Feynman's algorithm is an algorithm that is used to simulate the operations of a quantum computer on a classical computer." What does that have to do with timing or cache attacks?
2022-09-28 10:34:05 +0200 <dminuoso> https://wiki.c2.com/?FeynmanAlgorithm
2022-09-28 10:34:21 +0200 <dminuoso> phma: Just to oversimplify an assumption: imagine each choice of a random ladder influences the runtime of whole seconds (e.g. chosing `1` makes it run between 1.0s and 1.1s, chosing `2` makes it run between '2.0s and 2.1s', but the variation of 0.1 would be leaked information from the implementation.
2022-09-28 10:34:40 +0200 <dminuoso> Im not saying this is the case, but perhaps you can see how just picking a random ladder path might not be enough.
2022-09-28 10:35:14 +0200 <sm> which library function would you use to take just enough list elements to sum up to a target value ? takeWhile but with an accumulator?
2022-09-28 10:35:30 +0200 <dminuoso> sm: foldrM with Either?
2022-09-28 10:38:27 +0200 <dminuoso> That is, `Either [Int] Int` where you keep the sum on the Right side, and throw a Left with the solution
2022-09-28 10:39:03 +0200 <sm> Thanks! I'll look into this (or foldlM)
2022-09-28 10:39:23 +0200cfricke(~cfricke@user/cfricke)
2022-09-28 10:39:42 +0200 <sm> nifty solution
2022-09-28 10:41:07 +0200acidjnk(~acidjnk@p200300d6e7137a1628fe4ecf7cec9dba.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
2022-09-28 10:43:10 +0200ubert(~Thunderbi@77.119.161.212.wireless.dyn.drei.com) (Read error: Connection reset by peer)
2022-09-28 10:43:31 +0200ubert(~Thunderbi@77.119.161.212.wireless.dyn.drei.com)
2022-09-28 10:45:06 +0200 <sm> is this essentially monadic, so requiring an M function ?
2022-09-28 10:50:34 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.6)
2022-09-28 10:50:43 +0200cfricke(~cfricke@user/cfricke)
2022-09-28 10:51:53 +0200acidjnk(~acidjnk@p200300d6e7137a161827c7a2ee98ef4a.dip0.t-ipconnect.de)
2022-09-28 10:52:22 +0200 <dminuoso> :t foldrM
2022-09-28 10:52:23 +0200 <lambdabot> (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b
2022-09-28 10:53:47 +0200ft(~ft@p3e9bc57b.dip0.t-ipconnect.de) (Quit: leaving)
2022-09-28 10:56:04 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
2022-09-28 10:57:24 +0200 <sm> I mean is the problem monadic in essence ? or just something that requires an accumulator and short circuiting
2022-09-28 10:58:09 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-28 10:58:59 +0200 <sm> also, wouldn't I want foldlM here ? I want to scan just the first n elements
2022-09-28 11:00:31 +0200faultline(~christian@200116b82b5e1c0064b924bb43bde4ee.dip.versatel-1u1.de)
2022-09-28 11:03:23 +0200 <dminuoso> Right.
2022-09-28 11:03:45 +0200 <dminuoso> Well shortcircuiting is a monadic effect
2022-09-28 11:03:53 +0200 <dminuoso> That doesnt mean you need to explicitly go through >>= of course
2022-09-28 11:04:01 +0200 <dminuoso> I would probably just write a simple manual loop
2022-09-28 11:04:13 +0200kuribas(~user@silversquare.silversquare.eu)
2022-09-28 11:04:27 +0200 <[Leary]> > (\t l -> snd <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (inits l))) 20 [1..]
2022-09-28 11:04:29 +0200 <lambdabot> Just [1,2,3,4,5,6]
2022-09-28 11:04:35 +0200 <[Leary]> Or something like this. ^
2022-09-28 11:05:55 +0200 <sm> yeah that would have been sensible, but we have all these wonderful tools. Thanks dminuoso, upgraded my haskell fu today
2022-09-28 11:06:41 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 11:06:54 +0200 <sm> [Leary]++
2022-09-28 11:08:49 +0200 <dminuoso> Mmm, I like [Leary]'s version more. Though I would write it less dense.
2022-09-28 11:10:59 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-09-28 11:12:22 +0200chele(~chele@user/chele)
2022-09-28 11:12:30 +0200mastarija(~mastarija@2a05:4f46:e03:6000:328e:3c75:e042:cc19)
2022-09-28 11:13:16 +0200faultline(~christian@200116b82b5e1c0064b924bb43bde4ee.dip.versatel-1u1.de) (Remote host closed the connection)
2022-09-28 11:13:29 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 252 seconds)
2022-09-28 11:13:47 +0200 <sm> foldlM seemed the right way but it's late and I'm not quite smart enough. In python/php I'd have made an ordinary while loop, and sure would have spent less time
2022-09-28 11:13:58 +0200dr_merijn(~dr_merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
2022-09-28 11:14:12 +0200 <dminuoso> scanl feels more idiomatic though
2022-09-28 11:14:29 +0200 <sm> and brain cycles, for me and future me
2022-09-28 11:15:14 +0200 <sm> I might try a haskell while
2022-09-28 11:15:14 +0200 <sm> loop, I guess we have those
2022-09-28 11:15:23 +0200 <[exa]> y we no lenses for this
2022-09-28 11:16:02 +0200sagax(~sagax_nb@user/sagax)
2022-09-28 11:16:33 +0200 <kuribas> what does that do?
2022-09-28 11:17:00 +0200 <kuribas> inits has O(n^2) complexity
2022-09-28 11:18:00 +0200 <[exa]> kuribas: not if you don't consume the output
2022-09-28 11:18:28 +0200 <kuribas> [exa]: ah right
2022-09-28 11:18:36 +0200 <kuribas> @src inits
2022-09-28 11:18:36 +0200 <lambdabot> inits [] = [[]]
2022-09-28 11:18:36 +0200 <lambdabot> inits (x:xs) = [[]] ++ map (x:) (inits xs)
2022-09-28 11:19:30 +0200 <kuribas> why [[]] and not ([]:)
2022-09-28 11:19:43 +0200 <Axman6> phma: interesting idea - how many permutations of the possible random operations are there though? could I measure <side channel> and then try all the permutations of the order things could have happened in?
2022-09-28 11:20:51 +0200 <kuribas> sm: you can always write a tail recursive loop in haskell.
2022-09-28 11:21:05 +0200 <kuribas> sm: which is equivalent to what you would write in php/python
2022-09-28 11:21:32 +0200 <Axman6> src is almost always not what is actually used
2022-09-28 11:22:18 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 11:25:47 +0200 <kuribas> > scanl (:) [] [1..]
2022-09-28 11:25:50 +0200 <lambdabot> error:
2022-09-28 11:25:50 +0200 <lambdabot> • Occurs check: cannot construct the infinite type: a ~ [a]
2022-09-28 11:25:50 +0200 <lambdabot> Expected type: [a] -> [a] -> [a]
2022-09-28 11:25:58 +0200 <kuribas> > scanl (flip (:)) [] [1..]
2022-09-28 11:26:00 +0200 <lambdabot> [[],[1],[2,1],[3,2,1],[4,3,2,1],[5,4,3,2,1],[6,5,4,3,2,1],[7,6,5,4,3,2,1],[8...
2022-09-28 11:27:12 +0200 <kuribas> > (\t l -> reverse . snd <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l)) 20 [1..]
2022-09-28 11:27:14 +0200 <lambdabot> <hint>:1:101: error:
2022-09-28 11:27:14 +0200 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
2022-09-28 11:27:17 +0200waldo(~waldo@user/waldo) (Quit: quit)
2022-09-28 11:28:45 +0200 <kuribas> > let t = 20; l = [1..] in reverse . snd <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l)) 20 [1..]
2022-09-28 11:28:49 +0200 <lambdabot> error:
2022-09-28 11:28:49 +0200 <lambdabot> • Couldn't match expected type ‘t0 -> [a3] -> f (a0, [a])’
2022-09-28 11:28:49 +0200 <lambdabot> with actual type ‘Maybe (a1, [a2])’
2022-09-28 11:32:44 +0200luffy(~chenqisu1@183.217.201.220)
2022-09-28 11:33:57 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
2022-09-28 11:35:52 +0200 <ph88^> if i have ghc-options -with-rtsopts and then the user specifies his own rtsopts do the overwrite or supplement already set options ?
2022-09-28 11:36:34 +0200waldo(~waldo@user/waldo)
2022-09-28 11:40:51 +0200dr_merijn(~dr_merijn@86-86-29-250.fixed.kpn.net)
2022-09-28 11:41:34 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-09-28 11:41:40 +0200notzmv(~zmv@user/notzmv)
2022-09-28 11:44:09 +0200 <kuribas> > let t = 20; l = [1..] in (reverse . snd) <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l)) 20 [1..]
2022-09-28 11:44:12 +0200 <lambdabot> error:
2022-09-28 11:44:12 +0200 <lambdabot> • Couldn't match expected type ‘t0 -> [a3] -> f (a0, [a])’
2022-09-28 11:44:12 +0200 <lambdabot> with actual type ‘Maybe (a1, [a2])’
2022-09-28 11:44:44 +0200 <ph88^> kuribas, what voodoo is that
2022-09-28 11:45:04 +0200frost(~frost@user/frost) (Ping timeout: 252 seconds)
2022-09-28 11:45:33 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 258 seconds)
2022-09-28 11:49:36 +0200notzmv(~zmv@user/notzmv) (Ping timeout: 268 seconds)
2022-09-28 11:49:51 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2022-09-28 11:50:27 +0200talismanick(~talismani@2601:200:c100:c9e0::24ac) (Ping timeout: 248 seconds)
2022-09-28 11:51:54 +0200 <byorgey> kuribas: you just need to remove the 20 [1..] from the end, I think
2022-09-28 11:52:10 +0200 <kuribas> > let t = 20; l = [1..] in (reverse . snd) <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l))
2022-09-28 11:52:12 +0200 <lambdabot> Just [1,2,3,4,5,6]
2022-09-28 11:52:17 +0200 <kuribas> byorgey: thanks!
2022-09-28 11:52:23 +0200 <byorgey> \o/
2022-09-28 11:52:39 +0200 <kuribas> > map reverse (scanl (flip (:)) [] l)
2022-09-28 11:52:41 +0200 <lambdabot> error:
2022-09-28 11:52:41 +0200 <lambdabot> • Couldn't match expected type ‘[a]’ with actual type ‘Expr’
2022-09-28 11:52:41 +0200 <lambdabot> • In the third argument of ‘scanl’, namely ‘l’
2022-09-28 11:52:51 +0200 <kuribas> > map reverse (scanl (flip (:)) [] [1..])
2022-09-28 11:52:53 +0200 <lambdabot> [[],[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5],[1,2,3,4,5,6],[1,2,3,4,5,6,7],[1...
2022-09-28 11:53:31 +0200 <byorgey> > inits [1..]
2022-09-28 11:53:33 +0200 <lambdabot> [[],[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5],[1,2,3,4,5,6],[1,2,3,4,5,6,7],[1...
2022-09-28 11:54:35 +0200 <byorgey> oh, I see, you were talking about how inits takes quadratic time
2022-09-28 11:54:39 +0200 <kuribas> byorgey: I find the lazyness more obvious than in the @src definition.
2022-09-28 11:54:40 +0200 <kuribas> yeah
2022-09-28 11:56:39 +0200thyriaen(~thyriaen@2a02:8109:8340:686c:7383:e0e2:ad95:9fce)
2022-09-28 12:04:56 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 268 seconds)
2022-09-28 12:08:23 +0200gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-09-28 12:09:13 +0200lyle(~lyle@104.246.145.85)
2022-09-28 12:12:09 +0200titibandit(~titibandi@xdsl-212-8-150-57.nc.de) (Quit: Leaving.)
2022-09-28 12:12:47 +0200luffy(~chenqisu1@183.217.201.220) (Quit: Leaving)
2022-09-28 12:13:04 +0200luffy(~chenqisu1@183.217.201.220)
2022-09-28 12:14:16 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2022-09-28 12:15:21 +0200luffy(~chenqisu1@183.217.201.220) (Remote host closed the connection)
2022-09-28 12:15:24 +0200 <ph88^> kuribas, what have you just found out ? isn't it easier to just do [1..6] ?
2022-09-28 12:15:54 +0200luffy(~chenqisu1@183.217.201.220)
2022-09-28 12:16:15 +0200forell(~forell@user/forell) (Ping timeout: 244 seconds)
2022-09-28 12:16:41 +0200 <kuribas> ph88^: I found out that inits is linear what taking a single element.
2022-09-28 12:20:04 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-09-28 12:23:08 +0200forell(~forell@user/forell)
2022-09-28 12:25:25 +0200kuribas(~user@silversquare.silversquare.eu) (Quit: ERC (IRC client for Emacs 26.3))
2022-09-28 12:27:47 +0200Midjak(~Midjak@82.66.147.146)
2022-09-28 12:31:46 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-09-28 12:34:28 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-09-28 12:36:44 +0200jco(~jco@90-228-194-139-no542.tbcn.telia.com)
2022-09-28 12:38:45 +0200moonsheep(~user@user/moonsheep)
2022-09-28 12:39:16 +0200 <moonsheep> what is my best bet if I want to make a library type, whose constructors are not in scope, an instance of a class?
2022-09-28 12:39:32 +0200 <moonsheep> specifically, cryptonite's Ed25519 PublicKey
2022-09-28 12:39:51 +0200 <moonsheep> I want to make a map of PublicKeys but for that I need it to be an instance of Ord
2022-09-28 12:40:06 +0200 <moonsheep> unfortunately, the constructor of PublicKey is not exported by the module, so I can't standalone derive it
2022-09-28 12:40:10 +0200 <moonsheep> any ideas?
2022-09-28 12:44:16 +0200frost(~frost@user/frost)
2022-09-28 12:45:29 +0200 <[Leary]> moonsheep: If the number of keys will never be too large, consider just using an alist.
2022-09-28 12:46:15 +0200 <[Leary]> Otherwise I'd write an Ord instance by hand for a newtype over PublicKey.
2022-09-28 12:46:54 +0200 <moonsheep> yeah but I don't have access to the constructor, which I need to access the bytes in order to write an Ord instance
2022-09-28 12:46:55 +0200darkstardevx(~darkstard@192.183.207.94) (Ping timeout: 268 seconds)
2022-09-28 12:47:06 +0200 <moonsheep> as for the alist, I'll probably have to do that
2022-09-28 12:47:37 +0200 <moonsheep> I don't intend that have a large number of keys but not using a map somehow feels... wrong
2022-09-28 12:47:52 +0200lisbeths(uid135845@id-135845.lymington.irccloud.com)
2022-09-28 12:48:01 +0200 <[Leary]> moonsheep: You might be able to get away with, e.g. `compare = comparing show`.
2022-09-28 12:48:20 +0200 <moonsheep> oh damn
2022-09-28 12:48:31 +0200 <moonsheep> that's naughty
2022-09-28 12:49:11 +0200 <moonsheep> so, in summary, is there no better way without patching cryptonite?
2022-09-28 12:50:36 +0200pretty_dumm_guy(~trottel@eduroam-134-96-204-15.uni-saarland.de)
2022-09-28 12:51:45 +0200pretty_dumm_guy(~trottel@eduroam-134-96-204-15.uni-saarland.de) (Client Quit)
2022-09-28 12:51:49 +0200 <[Leary]> I don't know the library well enough to say. That ByteArrayAccess instance might be a complete enough interface to write something less naughty.
2022-09-28 12:52:43 +0200 <[Leary]> Though I guess that would need IO...
2022-09-28 12:52:49 +0200 <moonsheep> yeah I wanted to avoid that
2022-09-28 12:52:59 +0200 <moonsheep> I'm not really comfortable around Ptrs
2022-09-28 12:53:09 +0200 <[Leary]> So yeah, I doubt you can do much better from the outside.
2022-09-28 12:53:30 +0200 <moonsheep> hmm right thanks
2022-09-28 12:53:42 +0200 <moonsheep> I guess I'll just do the showing thing for now, as a temporary measure
2022-09-28 12:54:03 +0200 <moonsheep> I still want to Ord and Serialize them though, so might have to get a custom cryptonite
2022-09-28 12:55:17 +0200waleee(~waleee@h-176-10-137-138.NA.cust.bahnhof.se)
2022-09-28 12:58:43 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
2022-09-28 12:59:17 +0200waldo(~waldo@user/waldo) (Ping timeout: 268 seconds)
2022-09-28 12:59:30 +0200enoq(~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7)
2022-09-28 13:00:14 +0200xff0x(~xff0x@ai071162.d.east.v6connect.net)
2022-09-28 13:00:46 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-09-28 13:01:20 +0200rembo10(~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-28 13:01:48 +0200 <enoq> so I've got a list of Maybe Ints and I want to sum them up or get a None, is there a neat way to do that
2022-09-28 13:01:50 +0200 <enoq> traverse the list to a Maybe List and then reduce the list?
2022-09-28 13:03:52 +0200rembo10(~rembo10@main.remulis.com)
2022-09-28 13:04:11 +0200Joao003(~Joao003@187.85.87.1)
2022-09-28 13:04:42 +0200 <lortabac> > sequenceA [Just 1, Just 2]
2022-09-28 13:04:44 +0200 <lambdabot> Just [1,2]
2022-09-28 13:05:02 +0200 <lortabac> > sum <$> sequenceA [Just 1, Just 2]
2022-09-28 13:05:05 +0200 <lambdabot> Just 3
2022-09-28 13:05:18 +0200 <lortabac> > sum <$> sequenceA [Just 1, Just 2, Nothing]
2022-09-28 13:05:19 +0200 <lambdabot> Nothing
2022-09-28 13:05:35 +0200 <lortabac> enoq: is this what you are looking for? ↑
2022-09-28 13:05:38 +0200 <enoq> so pipe sum through applicative basically?
2022-09-28 13:05:45 +0200 <enoq> does that work for empty lists as well?
2022-09-28 13:06:11 +0200 <lortabac> > sum []
2022-09-28 13:06:11 +0200 <enoq> > sum <$> sequenceA []
2022-09-28 13:06:13 +0200 <lambdabot> 0
2022-09-28 13:06:14 +0200 <lambdabot> error:
2022-09-28 13:06:14 +0200 <lambdabot> • Ambiguous type variable ‘f0’ arising from a use of ‘show_M275246096707...
2022-09-28 13:06:14 +0200 <lambdabot> prevents the constraint ‘(Show (f0 Integer))’ from being solved.
2022-09-28 13:06:27 +0200 <enoq> I want Nothing if the list is empty
2022-09-28 13:06:51 +0200 <lortabac> then you need to add an explicit check
2022-09-28 13:06:58 +0200 <enoq> ok, nvm, I want 0
2022-09-28 13:07:00 +0200 <enoq> thanks
2022-09-28 13:07:39 +0200 <enoq> I really hate Haskell naming
2022-09-28 13:07:52 +0200 <enoq> sequenceA is a terrible name
2022-09-28 13:08:00 +0200 <moonsheep> > foldr (liftM2 (+)) Nothing []
2022-09-28 13:08:03 +0200 <lambdabot> Nothing
2022-09-28 13:08:08 +0200 <moonsheep> > foldr (liftM2 (+)) Nothing [Just 1, Just 2, Just 3]
2022-09-28 13:08:10 +0200 <lambdabot> Nothing
2022-09-28 13:08:16 +0200 <moonsheep> oh wait shit
2022-09-28 13:08:26 +0200 <moonsheep> well if you want zero you can just foldr1
2022-09-28 13:08:27 +0200 <ski> enoq : do you want `Nothing' in case there is at least one `Nothing' in the list ? or only in case all elements are `Nothing' ?
2022-09-28 13:08:56 +0200 <enoq> ski: Nothing if list is empty or if one Nothing occurs in the list
2022-09-28 13:09:21 +0200 <enoq> I suppose sequenceA is something like a stream right?
2022-09-28 13:09:28 +0200 <ski> `sequenceA'/`sequence' does the former. for the latter, there's no direct operation (that i'm aware of), but you can get most of the way with `catMaybes
2022-09-28 13:09:34 +0200 <ski> '
2022-09-28 13:10:31 +0200 <ski> `sequenceA'/`sequence', in this case (`Maybe') will "short-circuit" all the `Maybe'-actions in the list, giving `Nothing', in case there's at least one `Nothing', otherwise give a `Just' of the list of all the elements (that were inside the original `Justs')
2022-09-28 13:10:53 +0200 <ski> sequenceA [Just a,Just b,...Just y,Just z] = Just [a,b,...,y,z]
2022-09-28 13:10:53 +0200 <moonsheep> enoq: I mean I can't think of some clean solution right now, but what stops you from just pattern matching against the list and returning nothing if it's empty, or just the sequence or fold approach otherwise?
2022-09-28 13:11:16 +0200 <enoq> moonsheep: right, will go that route
2022-09-28 13:11:18 +0200 <ski> sequenceA [Just a,...,Just m,Nothing,Just o,...,Just z] = Nothing
2022-09-28 13:11:56 +0200moonsheep(~user@user/moonsheep) (Quit: ERC 5.4 (IRC client for GNU Emacs 28.2))
2022-09-28 13:12:04 +0200 <ski> "Nothing if list is empty or if one Nothing occurs in the list" -- well, that's a slightly less regular/uniform request, so it's slightly more involved
2022-09-28 13:12:31 +0200 <ski> i'd suggest using `null' to check if the list is empty, and if it isn't, then use `sequenceA'/`sequence'
2022-09-28 13:12:48 +0200 <ski> (well, `null', or pattern-matching, if it happens to be handy)
2022-09-28 13:13:35 +0200 <ski> > case [Just 0,Just 1,Just 2,Just 3,Just 4] of [] -> Nothing; ms -> sequenceA ms
2022-09-28 13:13:37 +0200 <lambdabot> Just [0,1,2,3,4]
2022-09-28 13:13:44 +0200 <ski> > case [Just 0,Just 1,Nothing,Just 3,Just 4] of [] -> Nothing; ms -> sequenceA ms
2022-09-28 13:13:46 +0200 <lambdabot> Nothing
2022-09-28 13:13:49 +0200 <ski> > case [] of [] -> Nothing; ms -> sequenceA ms
2022-09-28 13:13:51 +0200 <lambdabot> Nothing
2022-09-28 13:15:10 +0200 <ski> (the reason it's not uniform is that in the empty case, all the list elements are `Just' (all zero of them), none are `Nothing'. so, the uniform thing to do would be to get `Just []'. but you wanted `Nothing', so you have to do a special case for that)
2022-09-28 13:16:05 +0200 <ski> <enoq> ok, nvm, I want 0
2022-09-28 13:16:39 +0200 <ski> oh, you wanted `0' sum, after all ? (sorry, missed that, before) .. in that case, `sequenceA' is what you want, no extra check for if the list is empty
2022-09-28 13:16:41 +0200zaquest(~notzaques@5.130.79.72) (Remote host closed the connection)
2022-09-28 13:17:39 +0200 <ski> `foldr (listM2 (+)) (return 0)' would also work, yea
2022-09-28 13:17:48 +0200zaquest(~notzaques@5.130.79.72)
2022-09-28 13:18:11 +0200 <enoq> yep, thanks, was just interested in the edge case
2022-09-28 13:18:15 +0200 <ski> enoq : .. not quite sure what you mean by "I suppose sequenceA is something like a stream right?"
2022-09-28 13:18:31 +0200 <enoq> what does does it do?
2022-09-28 13:18:40 +0200 <enoq> create one applicative for all wrapped things?
2022-09-28 13:19:06 +0200 <ski> `foldr (liftA2 (+)) (pure 0) ms' does the same thing as `sum <$> sequenceA ms'
2022-09-28 13:19:28 +0200 <ski> except it doesn't construct an intermediate list
2022-09-28 13:19:45 +0200 <enoq> I suppose A2 wraps a binary function in an applicative?
2022-09-28 13:19:54 +0200 <ski> yes, you could say so
2022-09-28 13:20:13 +0200rembo10(~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-28 13:20:19 +0200 <ski> liftA2 :: (a -> b -> c) -> (Maybe a -> Maybe b -> Maybe c) -- in this case
2022-09-28 13:21:38 +0200 <enoq> thank you
2022-09-28 13:22:05 +0200 <ski> (using `liftA2',`pure', or using `liftM2',`return', won't make much difference here .. `Maybe' is an instance of both `Applicative' and `Monad', so these ought to do the same. in some cases, one might have a type which is only an instance of the former. and in some cases, the former might be more efficient than the latter)
2022-09-28 13:22:21 +0200rembo10(~rembo10@main.remulis.com)
2022-09-28 13:26:19 +0200 <ski> if `Applicative' had been invented around the same time as `Monad', then `sequence' and `liftM2' (and `return' and `ap') likely wouldn't have existed (well, `ap' might still have, as a handy default implementation of `(<*>)', in terms of `(>>=)'), and `sequenceA' might have been named `sequence' instead
2022-09-28 13:26:37 +0200 <ski> (and perhaps `pure' would have been named `return')
2022-09-28 13:26:41 +0200 <enoq> at some point someone needs to redo haskell with proper naming
2022-09-28 13:27:03 +0200 <enoq> like get rid of all the M and A and the mumbo jumbo operators like <*>
2022-09-28 13:28:00 +0200 <ski> and ditto for `mapM',`mapM_',`forM',`forM_' (using `Monad') vs. `traverse',`traverse_',`for',`for_' (using `Applicative')
2022-09-28 13:28:32 +0200 <ski> well, `f <$> foo <*> bar <*> baz' is a quite handy pattern
2022-09-28 13:28:50 +0200 <ski> if
2022-09-28 13:28:57 +0200 <ski> f :: A -> B -> C -> D
2022-09-28 13:29:04 +0200 <enoq> f `into` foo `pipe` ...
2022-09-28 13:29:06 +0200 <ski> foo :: I A
2022-09-28 13:29:08 +0200 <enoq> something like that
2022-09-28 13:29:09 +0200 <ski> bar :: I B
2022-09-28 13:29:15 +0200 <ski> baz :: I C
2022-09-28 13:29:16 +0200 <ski> then
2022-09-28 13:29:26 +0200 <ski> f <$> foo <*> bar <*> baz :: I D
2022-09-28 13:29:29 +0200 <byorgey> . o O ( that cleaned-up version of Haskell could just support idiom brackets )
2022-09-28 13:29:35 +0200 <ski> where `Applicative I'
2022-09-28 13:29:46 +0200 <ski> byorgey : well .. i have a better option in mind
2022-09-28 13:30:09 +0200 <ski> (idiom brackets don't go far enough)
2022-09-28 13:30:37 +0200 <byorgey> oh? do tell!
2022-09-28 13:30:39 +0200 <ski> enoq : i guess .. but i don't really see that as better than the current `<$>',`<*>'
2022-09-28 13:30:59 +0200 <enoq> it does the same yeah, but it's short and readable
2022-09-28 13:31:03 +0200 <ski> oh, well. i've talked about it in here, now and then
2022-09-28 13:31:18 +0200skidoesn't find the `into' and `pipe' suggestive
2022-09-28 13:31:28 +0200 <enoq> :p
2022-09-28 13:31:51 +0200nate3(~nate@98.45.169.16)
2022-09-28 13:32:05 +0200 <ski> byorgey : basically, extend Haskell syntax with a notion of "local lexical/static side-effects". using syntactic constructions reminiscent of quasi-quotation
2022-09-28 13:33:06 +0200 <enoq> there are a couple of other things as well that probably have been talked to death already
2022-09-28 13:33:18 +0200 <enoq> like use Mapable instead of Functor or Flatmappable instead of Monad
2022-09-28 13:34:21 +0200 <ski> for the sake of the argument, let's say these two constructions would look like `[> ... <]' respectivel `[< ... >]' .. i'm not married to this syntax, some alternate concrete syntax for it might be nicer
2022-09-28 13:34:37 +0200 <ski> anyway, consider an example
2022-09-28 13:34:46 +0200 <ski> data Person = MkPerson Name Age
2022-09-28 13:34:49 +0200 <ski> and parsers
2022-09-28 13:34:55 +0200 <ski> parseName :: Parser Name
2022-09-28 13:35:01 +0200 <ski> parseAge :: Parser Age
2022-09-28 13:35:15 +0200 <ski> now, we can construct a parser for `Person', like
2022-09-28 13:35:24 +0200 <ski> parsePerson :: Parser Person
2022-09-28 13:35:34 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 258 seconds)
2022-09-28 13:35:48 +0200 <ski> parsePerson = [> MkPerson [<parseName>] [<parseAge>] <]
2022-09-28 13:36:05 +0200 <ski> the intermediate expressions here have the following types
2022-09-28 13:36:23 +0200 <ski> [<parseName>] :: Name -- with `Parser'-side-effects
2022-09-28 13:36:41 +0200 <ski> [<parseAge >] :: Age -- with `Parser'-side-effects
2022-09-28 13:37:01 +0200 <ski> MkPerson [<parseName>] [<parseAge>] :: Person -- with `Parser'-side-effects
2022-09-28 13:37:06 +0200nate3(~nate@98.45.169.16) (Ping timeout: 260 seconds)
2022-09-28 13:37:36 +0200 <ski> and then `[> ... <]' lexically encapsulates the side-effects, reifying them into an ordinary effect represented by having the type `Parser Person'
2022-09-28 13:37:40 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-09-28 13:38:04 +0200 <ski> now, compare with Idiom brackets. let's write `[| ... |]' for those, for the purpose of this discussion
2022-09-28 13:38:09 +0200 <ski> we have a translation rule
2022-09-28 13:39:00 +0200 <ski> [| <expr0> <expr> ... |] = <expr0> <$> <expr> <*> ...
2022-09-28 13:39:04 +0200 <ski> or, in the nullary case
2022-09-28 13:39:17 +0200 <ski> [| <expr0> |] = pure <expr0>
2022-09-28 13:41:17 +0200 <ski> however, let's say you have some expression tree, with `Applicative' effects along *some* paths towards the root. now you want to introduce a new effect somewhere inside an expression subtree where there were no effects before. with idiom brackets, you have to annotate the *whole* path from that place to where your effect can "join up" with the other effects. so you have to place a number of idiom brackets
2022-09-28 13:41:23 +0200 <ski> equal to the number of applications on that path
2022-09-28 13:41:45 +0200 <ski> with my syntax, you don't need to do that, you *only* need to annotate the site where you actually want to introduce the effect
2022-09-28 13:42:01 +0200 <ski> this is because my translation rules look like
2022-09-28 13:42:34 +0200 <ski> [> [< <expr> >] <] = <expr>
2022-09-28 13:43:48 +0200 <ski> [> <expr0> <Expr> <] = <expr0> <$> [> <Expr> <] -- where `<Expr>' is an expression that contains at least one (undischarged by `[>...<]') `[<...>]' (while `<expr>' contains none)
2022-09-28 13:44:19 +0200 <ski> [> <Expr0> <expr> <] = ($ <expr>) <$> [> <Expr> <]
2022-09-28 13:44:48 +0200 <ski> [> <Expr0> <Expr> <] = [> <Expr0> <] <*> [> <Expr> <]
2022-09-28 13:45:03 +0200 <ski> [> <expr> <] = pure <expr>
2022-09-28 13:46:14 +0200 <ski> so, these rules propagate the "reify" brackets `[> ... <]' down each path in the tree where there is at least one "reflect" bracket `[< ... >]' somewhere inside
2022-09-28 13:46:34 +0200 <ski> (while also making sure to only rely on `Functor', rather than `Applicative', when possible)
2022-09-28 13:46:53 +0200 <ski> furthermore, this can easily also be extended to cover `Monad'
2022-09-28 13:47:45 +0200 <ski> [> let <pat> = <Expr> in <Expr'> <] = do <pat> <- [> <Expr> <]; [> <Expr'> <]
2022-09-28 13:48:29 +0200Joao003(~Joao003@187.85.87.1) (Quit: Client closed)
2022-09-28 13:48:46 +0200Joao003(~Joao003@187.85.87.1)
2022-09-28 13:49:07 +0200 <ski> [> if <Expr> then <Expr'0> else <Expr'1> <] = [> <Expr> <] >>= \<id> -> if <id> then [> <Expr'0> <] else [> <Expr'1> <] -- where `<id>' is fresh
2022-09-28 13:50:02 +0200 <ski> [> case <Expr> of <pat> -> <Expr'>; ... <] = [> <Expr> <] >>= \case <pat> -> [> <Expr'> <]; ...
2022-09-28 13:51:25 +0200Joao003(~Joao003@187.85.87.1) (Client Quit)
2022-09-28 13:52:46 +0200 <ski> one important case to consider is what happens with `[> \<pat> -> <expr> <]' .. it turns out that this case would require a transformation from `A -> F B' to `F (A -> B)' (an inverse of `strength') .. so, either we require that the body of the lambda abstraction does *not* contain any bare reflects (`[<...>]'s), *or* we introduce a dependency on a type class with such an operation
2022-09-28 13:54:06 +0200 <ski> now, there's two things i haven't worked out here : (a) what about nesting effects (e.g. nesting `Applicative's) ? we'd like to be able to do that smoothly, in the occasional cases where it occurs; and (b) i'd like a reasonable story for monad transformers too
2022-09-28 13:54:17 +0200 <ski> byorgey : ^ that's basically it
2022-09-28 13:54:20 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2022-09-28 13:54:41 +0200 <ski> (oh, and i have type system rules as well, not just translation rules)
2022-09-28 13:55:38 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2022-09-28 13:56:05 +0200 <ski> (one could also possibly allow some extra syntactical nicities, like saying `[<parsePerson>] = MkPerson [<parseName>] [<parseAge>]', instead of what i said above)
2022-09-28 13:57:17 +0200kenran(~user@user/kenran) (Remote host closed the connection)
2022-09-28 13:57:17 +0200notzmv(~zmv@user/notzmv)
2022-09-28 13:58:31 +0200 <ski> hm, i should also emphasize that an expression can *only* have a side-effect here, if there lexically occurs a (bare) reflect `[<...>]' expression inside of it. so merely calling a function won't introduce side-effects (this is also why lambda bodies have to be side-effect-free, unless you have such an inverse of `strength'). and you can always reify with `[>...<]' to get back to the usual side-effect free
2022-09-28 13:58:37 +0200 <ski> Haskell
2022-09-28 14:00:14 +0200 <ski> you can still use equational reasoning. you just have to make sure you don't duplicate or discard reflect expressions, unless you know the effects they represent are duplicable or discardable. and similarly, you can't move one reflect expression past another, when refactoring (or reasoning), unless you know they commute with each other. but that's it, that's the restrictions you have to keep in mind
2022-09-28 14:00:17 +0200titibandit(~titibandi@xdsl-212-8-150-57.nc.de)
2022-09-28 14:03:15 +0200__monty__(~toonn@user/toonn)
2022-09-28 14:06:31 +0200 <byorgey> ski: very nice, I like it
2022-09-28 14:07:43 +0200 <ski> it was inspired by idiom brackets, and by quasi-quotation in the Lisps (and MetaML), and by a notion of "focusing" in some type systems / logics
2022-09-28 14:08:03 +0200darkstardevx(~darkstard@192.183.207.94)
2022-09-28 14:08:32 +0200 <ski> (right, there is also one other issue i have to work out (which ought to be made to play nicely with nesting different kinds of effects), and that is how to naturally present `join'. i have some ideas, but they're not fully cooked)
2022-09-28 14:09:44 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 14:10:56 +0200waldo(~waldo@user/waldo)
2022-09-28 14:11:24 +0200 <dminuoso> sm: By the way, recall the nested megaparsec by the way? I just exfiltrate the nested error bundle by throwing it as an IO exception. :P
2022-09-28 14:11:38 +0200 <dminuoso> The solution was so simple in the end.
2022-09-28 14:16:00 +0200nschoe(~quassel@2a01:e0a:8e:a190:23a7:87b9:3709:55dd)
2022-09-28 14:19:03 +0200 <ski> enoq : i don't believe `Mappable' and `Flatmappable' would be an improvement. imho, the (general) unfamiliarity of the names `Functor',`Monad' is a feature, not a bug, meaning they don't come with as much unwanted connotations/expectations. people can more approach them with a fresh mind. the other side of this is that if you already happen to know a little about functors and monads in category theory, then
2022-09-28 14:19:09 +0200 <ski> that knowledge *does* correctly apply here
2022-09-28 14:19:45 +0200 <enoq> it would at least get rid of the Burritos
2022-09-28 14:20:33 +0200 <ski> yea, i'm no fan of that kind of monad tutorial .. i prefer the more practically oriented ones, showing the kind of boiler-plate code that you can abstract away with one or other specific monad
2022-09-28 14:21:01 +0200 <enoq> yes, that's how it should be done :P
2022-09-28 14:21:49 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 244 seconds)
2022-09-28 14:22:14 +0200img(~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2022-09-28 14:22:38 +0200img(~img@user/img)
2022-09-28 14:24:09 +0200img(~img@user/img) (Client Quit)
2022-09-28 14:24:10 +0200 <ski> (i often think "What the hell are Monads?" by Noel Winstanley in 1999-02 at <https://www-users.mat.umk.pl/~fly/materialy/fp/haskell-doc/Monads.html> is possibly the best monad tutorial/intro. i think it's also possibly the first non-research-paper general monad tutorial)
2022-09-28 14:26:33 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 14:27:11 +0200img(~img@user/img)
2022-09-28 14:27:39 +0200 <ski> ("You Could Have Invented Monads! (And Maybe You Already Have.)" by dpiponi (Dan Piponi) in 2006-08-07 at <http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html> also isn't bad. and for a first quick overview (not a tutorial), i also like "Escaping Hell with Monads" by Philip Nilsson in 2017-05-08 at <https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/>)
2022-09-28 14:27:50 +0200 <ski> then there are some more in-depth ones, like
2022-09-28 14:27:59 +0200 <ski> @where AAM
2022-09-28 14:27:59 +0200 <lambdabot> http://www.haskell.org/haskellwiki/All_About_Monads
2022-09-28 14:28:03 +0200 <ski> @where MTSS
2022-09-28 14:28:03 +0200 <lambdabot> "Monad Transformers Step by Step" by Martin Grabmüller in 2006-10-16 (draft) at <https://page.mi.fu-berlin.de/scravy/realworldhaskell/materialien/monad-transformers-step-by-step.pdf>
2022-09-28 14:28:06 +0200 <ski> and also
2022-09-28 14:28:12 +0200 <ski> @where Typeclassopedia
2022-09-28 14:28:12 +0200 <lambdabot> http://www.haskell.org/haskellwiki/Typeclassopedia
2022-09-28 14:28:50 +0200 <ski> (and i'm probably forgetting some that i've seen and liked)
2022-09-28 14:29:03 +0200 <jean-paul[m]> MTSS link is dead
2022-09-28 14:30:48 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 265 seconds)
2022-09-28 14:32:36 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 14:33:31 +0200 <ski> dpiponi's "Monads, a Field Guide" in 2006-10-21 at <http://blog.sigfpe.com/2006/10/monads-field-guide.html> also has a nice diagram of some monads, and combinations with monad transformers
2022-09-28 14:35:24 +0200 <ski> jean-paul[m] : oh, so it is. ty for telling us. i don't think i've checked that link in a while. it seems <https://web.archive.org/web/20201108001845/https://page.mi.fu-berlin.de/scravy/realworldhaskell/ma…> works
2022-09-28 14:35:27 +0200kenran(~user@user/kenran)
2022-09-28 14:35:48 +0200 <jean-paul[m]> np. thanks for that great pile of reading. :)
2022-09-28 14:36:14 +0200 <ski> @where+ MTSS "Monad Transformers Step by Step" by Martin Grabmüller in 2006-10-16 (draft) at <https://web.archive.org/web/20201108001845/https://page.mi.fu-berlin.de/scravy/realworldhaskell/ma…>
2022-09-28 14:36:14 +0200 <lambdabot> Done.
2022-09-28 14:38:01 +0200 <ski> anyway : prerequisites for tackling `Monad' include : understanding higher-order functions,polymorphism,parameterized data types,type classes. also, you should probably try to understand `Functor' first, and probably also `Applicative', these days
2022-09-28 14:38:17 +0200 <ski> Typeclassopedia has exercises for `Functor' and `Applicative' as well
2022-09-28 14:38:32 +0200 <dr_merijn> Did someone recommend wadler's paper yet?:p
2022-09-28 14:38:45 +0200 <ski> er, i don't think anyone did, today
2022-09-28 14:38:58 +0200 <ski> (i linked to his monad page, the other day, though)
2022-09-28 14:39:16 +0200 <ski> <ski> you could try the older Wadler papers at <https://homepages.inf.ed.ac.uk/wadler/topics/monads.html> -- Wadler papers are usually quite readable
2022-09-28 14:39:22 +0200 <ski> (start from the oldest one)
2022-09-28 14:39:33 +0200 <dr_merijn> 50 links on blogposts and tutorials and you didn't even start with his? :p
2022-09-28 14:39:54 +0200 <ski> well .. some people feel intimidated by diving into research papers
2022-09-28 14:39:59 +0200 <dr_merijn> I still think Wadler's monad paper is one of the best/easiest intros
2022-09-28 14:40:17 +0200 <dr_merijn> ski: Sure, but that's just a teachable moment about how some are fuzzy and welcoming :p
2022-09-28 14:40:37 +0200 <ski> (even though Wadler's ones are usually quite readable, also to people who're not really into type systems stuff)
2022-09-28 14:40:42 +0200 <ski> yes
2022-09-28 14:42:07 +0200 <ski> for someone new, i might point them to Nilsson's non-tutorial, and then possibly to Winstanley's or possibly dpiponi's tutorial. then, you could try a Wadler paper, if you wish
2022-09-28 14:42:33 +0200skiagrees about the Wadler papers being great
2022-09-28 14:43:19 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 14:44:53 +0200Guest73(~Guest73@p200300ef9718357f545f1ba775403e5c.dip0.t-ipconnect.de)
2022-09-28 14:45:46 +0200 <ski> jean-paul[m] : anyway, that's the reason i was explicitly listing the links here, in case a lurker might be interested to try them out ..
2022-09-28 14:47:23 +0200coot(~coot@213.134.165.79)
2022-09-28 14:49:10 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 258 seconds)
2022-09-28 14:50:01 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 260 seconds)
2022-09-28 14:50:13 +0200 <jco> Hi, I have a small Template Haskell example here: https://gitlab.com/joncol/hello-template-haskell/blob/main/src/Dummy.hs#L17. Can I change `deriveDummy` somehow, so that the parameter `x` is of the type that the `name` parameter specifies?
2022-09-28 14:56:01 +0200 <ski> without some kind of typed version of `Name', like `NameT a' (dunno if something like that exists in TH), i think the answer is no (at least if you want to keep the same type for `deriveDummy')
2022-09-28 14:57:17 +0200 <ski> (perhaps it would be possible to pass a `Dynamic' instead, and then check that the hidden type agrees with the type that `a' describes .. not sure)
2022-09-28 14:57:43 +0200 <ski> (you might want someone with more TH experience, though)
2022-09-28 14:58:23 +0200 <jco> It's not a requirement that the type of `deriveDummy` isn't changed...
2022-09-28 14:59:01 +0200 <ski> hm, you'd also need to bundle the `TextShow a' constraint, somewhere
2022-09-28 15:00:14 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Remote host closed the connection)
2022-09-28 15:00:49 +0200 <ski> i don't know if it's possible to compare the `TypeRep' inside a `Dynamic' with what `conT' returns
2022-09-28 15:00:58 +0200 <ski> @hoogle conT
2022-09-28 15:00:58 +0200 <lambdabot> Control.Monad.Trans.Cont cont :: ((a -> r) -> r) -> Cont r a
2022-09-28 15:00:58 +0200 <lambdabot> Control.Monad.Cont cont :: () => a -> r -> r -> Cont r a
2022-09-28 15:00:58 +0200 <lambdabot> Language.Haskell.TH.Lib conT :: Name -> TypeQ
2022-09-28 15:01:03 +0200 <ski> @hoogle Dynamic -> TypeRep
2022-09-28 15:01:05 +0200 <lambdabot> Data.Rank1Dynamic dynTypeRep :: Dynamic -> TypeRep
2022-09-28 15:01:05 +0200 <lambdabot> Data.Typeable typeOf :: forall a . Typeable a => a -> TypeRep
2022-09-28 15:01:05 +0200 <lambdabot> Protolude typeOf :: Typeable a => a -> TypeRep
2022-09-28 15:01:07 +0200zebrag(~chris@user/zebrag)
2022-09-28 15:01:17 +0200 <ski> ok, the other one's a `TypeQ'
2022-09-28 15:01:29 +0200 <jco> The `TextShow` constraint is only something I used in this example. It will not be needed "IRL". I just want to understand the basics of this. It seems that it *should* not be that difficult to have one parameter be of the type specified by another. Maybe I'm missing something...
2022-09-28 15:01:54 +0200 <ski> "have one parameter be of the type specified by another" -- basically sounds like dependent types, to me
2022-09-28 15:02:18 +0200 <ski> unless you can do phantom tricks, like `ExprT'
2022-09-28 15:02:36 +0200talismanick(~talismani@2601:200:c100:c9e0::24ac)
2022-09-28 15:02:50 +0200 <ski> @hoogle TExp
2022-09-28 15:02:50 +0200 <lambdabot> Language.Haskell.TH data TExp (a :: TYPE (r :: RuntimeRep))
2022-09-28 15:02:51 +0200 <lambdabot> Language.Haskell.TH.Syntax newtype TExp (a :: TYPE (r :: RuntimeRep))
2022-09-28 15:02:51 +0200 <lambdabot> Language.Haskell.TH.Syntax TExp :: Exp -> TExp (a :: TYPE (r :: RuntimeRep))
2022-09-28 15:03:01 +0200 <ski> ah, it was called `TExp' (i forgot)
2022-09-28 15:03:25 +0200 <jco> Can I use that here you think?
2022-09-28 15:03:45 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 252 seconds)
2022-09-28 15:04:08 +0200 <ski> you'd need a corresponding version for `Name', i guess `TName'
2022-09-28 15:04:09 +0200luffy(~chenqisu1@183.217.201.220) (Ping timeout: 265 seconds)
2022-09-28 15:04:28 +0200 <ski> deriveDummy :: TextShow a => TName a -> a -> Q [Dec]
2022-09-28 15:04:37 +0200 <ski> but i dunno if there is anything like that
2022-09-28 15:04:51 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 15:05:18 +0200 <ski> (also, i'm thinking `a' should be a liftable type .. but perhaps `TextShow' serves a similar purpose, in your example)
2022-09-28 15:07:45 +0200 <ski> (like <https://hackage.haskell.org/package/th-lift-0.8.2/docs/Language-Haskell-TH-Lift.html>)
2022-09-28 15:10:13 +0200 <dr_merijn> jco: What are you trying to figure out?
2022-09-28 15:10:19 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 15:14:46 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
2022-09-28 15:19:12 +0200Guest73(~Guest73@p200300ef9718357f545f1ba775403e5c.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2022-09-28 15:24:25 +0200 <jco> dr_merijn: I basically want to be able to use TH to generate an instance of a typeclass for a type T. And in that instance definition, I want to be able to use values of the type T, that are passed in as arguments to the typeclass-generating TH function...
2022-09-28 15:25:52 +0200 <jco> dr_merijn: To avoid having duplicated (long) typeclass instance definitions, where everything, except some small parts (the values) will be repeated.
2022-09-28 15:26:23 +0200 <jco> dr_merijn: I assume there are other, maybe simpler and better ways of doing this, but I just want to know if it's possible...
2022-09-28 15:27:02 +0200 <jco> dr_merijn: Full example at https://gitlab.com/joncol/hello-template-haskell/blob/main/src/Dummy.hs, but maybe that is still unclear what I want to do with `special` there...
2022-09-28 15:29:02 +0200 <dr_merijn> jco: What's breaking in that example?
2022-09-28 15:29:14 +0200poscat0x04(~poscat@2408:8206:4823:2a7:d78b:34b7:cd4f:29cd) (Quit: Bye)
2022-09-28 15:31:34 +0200inversed(~inversed@90.209.137.56) (Ping timeout: 246 seconds)
2022-09-28 15:33:23 +0200zer0bitz(~zer0bitz@2001:2003:f748:2000:b409:b96f:ba06:b5f)
2022-09-28 15:33:30 +0200poscat(~poscat@2408:8206:4823:fc46:6bc1:f6c:f388:b18d)
2022-09-28 15:34:30 +0200inversed(~inversed@90.209.137.56)
2022-09-28 15:38:26 +0200poscat(~poscat@2408:8206:4823:fc46:6bc1:f6c:f388:b18d) (Quit: Bye)
2022-09-28 15:41:51 +0200poscat(~poscat@2408:8206:4823:fd6f:98ab:5c38:136c:5932)
2022-09-28 15:43:17 +0200ph88^(~ph88@95.90.247.31) (Quit: Leaving)
2022-09-28 15:44:30 +0200frost(~frost@user/frost) (Ping timeout: 252 seconds)
2022-09-28 15:44:52 +0200causal(~user@50.35.83.177) (Quit: WeeChat 3.6)
2022-09-28 15:45:15 +0200gmg(~user@user/gehmehgeh) (Quit: Leaving)
2022-09-28 15:47:50 +0200 <maralorn> When I "cabal run prog" my program it complains that my program has not been built with -prof. But I have done `cabal configure --enable-library-profiling --enable-executable-profiling` and put `-fprof-auto` into my .cabal file
2022-09-28 15:48:09 +0200gmg(~user@user/gehmehgeh)
2022-09-28 15:50:49 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 15:50:57 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-09-28 15:52:29 +0200 <maralorn> Huh, adding `-prof` fixes it, despite cabal printing that one should not do this.
2022-09-28 15:52:51 +0200 <geekosaur> that one you might ask in #hackage
2022-09-28 15:53:08 +0200 <geekosaur> include cabal-install version and probably Cabal library version
2022-09-28 15:53:49 +0200jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-09-28 15:55:28 +0200jakalx(~jakalx@base.jakalx.net)
2022-09-28 15:55:42 +0200waleee(~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Quit: WeeChat 3.6)
2022-09-28 15:57:00 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Remote host closed the connection)
2022-09-28 15:58:04 +0200 <jco> dr_merijn: Nothing is breaking in the example, but instead of `x` being the type specified by `name`, it has only has type `TextShow a => a`.
2022-09-28 15:58:27 +0200 <jco> dr_merijn: (Which is what I want to figure out how to specify.)
2022-09-28 16:02:11 +0200slack1256(~slack1256@191.125.227.202)
2022-09-28 16:07:19 +0200moonsheep(~user@user/moonsheep)
2022-09-28 16:07:59 +0200 <moonsheep> how can I serialize a `Ptr Word8' (obviously knowing its length) with cereal? do I have to somehow turn it into a `ByteString' or is there a better way?
2022-09-28 16:09:39 +0200Sgeo(~Sgeo@user/sgeo)
2022-09-28 16:10:15 +0200 <moonsheep> the closest I've found is `peekBytes' from the ptr package
2022-09-28 16:12:58 +0200shriekingnoise(~shrieking@186.137.167.202)
2022-09-28 16:18:22 +0200 <dr_merijn> moonsheep: Where are you getting the Ptr from?
2022-09-28 16:18:28 +0200 <dr_merijn> Your own code? or externally?
2022-09-28 16:20:16 +0200 <dr_merijn> moonsheep: Because depending on the answer, turning it into a ByteString is gonna be super cheap :p
2022-09-28 16:21:32 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.6)
2022-09-28 16:22:01 +0200 <moonsheep> dr_merijn: `withByteArray' from `ByteArrayAccess ba' in the memory package
2022-09-28 16:23:16 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 16:24:01 +0200 <dr_merijn> Ugh, I never liked that class. Ok, that probably rules out any cheap conversions
2022-09-28 16:24:18 +0200 <dr_merijn> moonsheep: Basically, the only API cereal supports is most likely ByteString
2022-09-28 16:24:25 +0200hrberg(~quassel@171.79-160-161.customer.lyse.net) (Ping timeout: 246 seconds)
2022-09-28 16:25:16 +0200 <dr_merijn> moonsheep: Now, ByteString is just a thin wrapper around "ForeignPtr Word8" with an offset and size. (ForeignPtr just being a wrapper for Ptr with a finalizer), so you can fairly trivially convert ForeignPtrs to ByteString directly
2022-09-28 16:25:37 +0200Sose(~sose@mobile-access-567367-206.dhcp.inet.fi)
2022-09-28 16:25:48 +0200 <dr_merijn> But withByteArray sounds like the Ptr is only gonna be valid within the bracket and converting to ForeignPtr would leak the ptr/violate that
2022-09-28 16:28:23 +0200 <sm> dminuoso: hurrah! \o/
2022-09-28 16:28:24 +0200 <sm> finding out the simple solution seems often extra costly with haskell. Imagine if there had been a nice maintained cookbook, "rum an inner parser" would have been there
2022-09-28 16:29:09 +0200 <dr_merijn> sm: Because the set of things that have "simple solutions" is considerably larger in Haskell :p
2022-09-28 16:29:39 +0200 <dr_merijn> in python everything either has an obvious simple solution or just go "welp...I'm fucked" and do it the complicated way for a lot of issues ;)
2022-09-28 16:30:30 +0200 <sm> fair but we can lean on that only so many years before it rings hollow
2022-09-28 16:30:45 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 16:31:25 +0200 <dr_merijn> I dunno, most other languages don't really seem to have "nice maintained cookbooks" either, so seems unfair to single out specifically
2022-09-28 16:31:31 +0200 <sm> parsing is super common, megaparsec is our most popular lib for it, it has among the best docs of haskell libs, yet,,
2022-09-28 16:31:34 +0200 <dr_merijn> methinks it's just programmers who are the problem ;)
2022-09-28 16:31:48 +0200smgoes to see if it's documented
2022-09-28 16:31:57 +0200 <dr_merijn> I think megaparsec docs were...considerably better when it was first forked
2022-09-28 16:32:42 +0200 <dr_merijn> The latest versions docs are considerably less intuitively navigatable and I have to rely on the tutorial/book chapter frequently
2022-09-28 16:33:08 +0200 <dr_merijn> the re-exports they use now hide a lot of stuff too
2022-09-28 16:33:25 +0200 <dr_merijn> but people like reworking it more than they like updating the docs :p
2022-09-28 16:34:42 +0200 <sm> sorry to hear that. Do you mean the haddocks ?
2022-09-28 16:34:59 +0200 <sm> dminuoso, is https://markkarpov.com/tutorial/megaparsec.html#catching-parse-errors-in-a-running-parser relevant to this?
2022-09-28 16:35:36 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 260 seconds)
2022-09-28 16:35:37 +0200jonathanx(~jonathan@h-98-128-168-222.NA.cust.bahnhof.se) (Remote host closed the connection)
2022-09-28 16:37:05 +0200 <sm> it's not the simple cookbook I imagined, but it's pretty good
2022-09-28 16:37:26 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 265 seconds)
2022-09-28 16:38:04 +0200 <dr_merijn> sm: The haddocks yes
2022-09-28 16:38:14 +0200Sose(~sose@mobile-access-567367-206.dhcp.inet.fi) (Quit: Leaving)
2022-09-28 16:38:49 +0200akegalj(~akegalj@213-202-90-31.dsl.iskon.hr)
2022-09-28 16:39:01 +0200 <sm> at least php style comments on haddocks would help
2022-09-28 16:40:46 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 16:41:54 +0200kuribas(~user@silversquare.silversquare.eu)
2022-09-28 16:42:32 +0200Guest73(~Guest73@p200300ef9718351a900cd859c72eccfd.dip0.t-ipconnect.de)
2022-09-28 16:42:50 +0200yvan-sraka(~yvan-srak@2a02:2788:224:71c:9500:1293:30f0:c5fc)
2022-09-28 16:44:03 +0200 <monochrom> Unpopular opinion: I despise cookbook cultures.
2022-09-28 16:45:46 +0200 <dr_merijn> monochrom: Same
2022-09-28 16:46:03 +0200 <dr_merijn> And back when I touched PHP I found a lot of the comments...very bad quality
2022-09-28 16:47:31 +0200 <monochrom> In positive news, I have learned the löb function! I am also learning Löb's theorem, actually modal logics too.
2022-09-28 16:51:06 +0200yvan-sraka(~yvan-srak@2a02:2788:224:71c:9500:1293:30f0:c5fc) (Remote host closed the connection)
2022-09-28 16:51:16 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 268 seconds)
2022-09-28 16:51:42 +0200waldo(~waldo@user/waldo) (Quit: quit)
2022-09-28 16:52:23 +0200 <moonsheep> dr_merijn: sorry for the late reply. what should I do then? how can I copy the ptr into a brand new bytestring?
2022-09-28 16:52:55 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds)
2022-09-28 16:53:29 +0200 <monochrom> I have also realized: If I have a memoizing recursion combinator ((I -> A) -> (I -> A)) -> (I -> A), meaning it hides a data structure F A for storing I->A, then F is a representable functor! represented by I. And I can also rearrange the type to (I -> ((I -> A) -> A)) -> (I -> A) = F (F A -> A) -> F A, so it's löb too.
2022-09-28 16:54:30 +0200 <dolio> That's cute.
2022-09-28 16:59:05 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 16:59:26 +0200jco(~jco@90-228-194-139-no542.tbcn.telia.com) (Remote host closed the connection)
2022-09-28 17:04:26 +0200 <ski> "Logic of Provability" by George Boolos might be interesting, re Löb
2022-09-28 17:09:12 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 17:09:28 +0200jpds1(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2022-09-28 17:10:23 +0200 <dr_merijn> moonsheep: You probably want: https://hackage.haskell.org/package/bytestring-0.11.3.1/docs/Data-ByteString.html#v:packCStringLen
2022-09-28 17:10:43 +0200 <dr_merijn> moonsheep: (note that CStringLen is basically just a tuple of a pointer and a length)
2022-09-28 17:12:00 +0200jpds1(~jpds@gateway/tor-sasl/jpds)
2022-09-28 17:12:17 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 17:13:25 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 250 seconds)
2022-09-28 17:14:30 +0200 <moonsheep> dr_merijn: ah tysm!
2022-09-28 17:20:13 +0200 <Franciman> congrats dr_merijn for the dr
2022-09-28 17:24:36 +0200dr_merijn(~dr_merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
2022-09-28 17:26:49 +0200nschoe(~quassel@2a01:e0a:8e:a190:23a7:87b9:3709:55dd) (Ping timeout: 268 seconds)
2022-09-28 17:27:47 +0200kenran(~user@user/kenran) (Remote host closed the connection)
2022-09-28 17:33:23 +0200nate3(~nate@98.45.169.16)
2022-09-28 17:34:41 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-28 17:37:11 +0200mikoto-chan(~mikoto-ch@2001:999:680:550c:3900:bcbe:e04:51b9)
2022-09-28 17:38:19 +0200nate3(~nate@98.45.169.16) (Ping timeout: 265 seconds)
2022-09-28 17:41:13 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 17:43:02 +0200kuribas(~user@silversquare.silversquare.eu) (Read error: Connection reset by peer)
2022-09-28 17:43:15 +0200kuribas(~user@silversquare.silversquare.eu)
2022-09-28 17:44:38 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:445e:b42c:e761:f5db) (Quit: WeeChat 2.8)
2022-09-28 17:46:00 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds)
2022-09-28 17:46:45 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 17:47:53 +0200slac36995(~slack1256@186.11.98.128)
2022-09-28 17:49:55 +0200slack1256(~slack1256@191.125.227.202) (Ping timeout: 248 seconds)
2022-09-28 17:50:58 +0200dr_merijn(~dr_merijn@86-86-29-250.fixed.kpn.net)
2022-09-28 17:51:07 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 250 seconds)
2022-09-28 17:51:59 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-09-28 17:53:00 +0200gmg(~user@user/gehmehgeh)
2022-09-28 17:53:39 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-09-28 17:54:23 +0200gmg(~user@user/gehmehgeh)
2022-09-28 17:54:40 +0200mikoto-chan(~mikoto-ch@2001:999:680:550c:3900:bcbe:e04:51b9) (Ping timeout: 244 seconds)
2022-09-28 17:56:01 +0200acidjnk_new(~acidjnk@p200300d6e7137a441827c7a2ee98ef4a.dip0.t-ipconnect.de)
2022-09-28 17:59:21 +0200acidjnk(~acidjnk@p200300d6e7137a161827c7a2ee98ef4a.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
2022-09-28 17:59:46 +0200Tuplanolla(~Tuplanoll@91-159-69-34.elisa-laajakaista.fi)
2022-09-28 18:11:22 +0200chele(~chele@user/chele) (Remote host closed the connection)
2022-09-28 18:14:05 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 250 seconds)
2022-09-28 18:14:52 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 18:18:47 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 18:20:41 +0200jero98772(~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c)
2022-09-28 18:28:39 +0200fmgornick(~fmgornick@96.72.43.173)
2022-09-28 18:28:49 +0200 <fmgornick> ?src head
2022-09-28 18:28:50 +0200 <lambdabot> head (x:_) = x
2022-09-28 18:28:50 +0200 <lambdabot> head [] = error "Prelude.head: empty list"
2022-09-28 18:28:58 +0200jmdaemon(~jmdaemon@user/jmdaemon)
2022-09-28 18:29:08 +0200fmgornick(~fmgornick@96.72.43.173) (Client Quit)
2022-09-28 18:30:04 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 246 seconds)
2022-09-28 18:30:22 +0200 <EvanR> head, one of the sharper tools in the box
2022-09-28 18:31:14 +0200econo(uid147250@user/econo)
2022-09-28 18:33:18 +0200moonsheep(~user@user/moonsheep) (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1))
2022-09-28 18:34:04 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 18:35:13 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 18:36:24 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 18:38:15 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 252 seconds)
2022-09-28 18:38:42 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-09-28 18:39:35 +0200Everything(~Everythin@37.115.210.35)
2022-09-28 18:39:55 +0200gmg(~user@user/gehmehgeh)
2022-09-28 18:40:12 +0200kuribas(~user@silversquare.silversquare.eu) (Remote host closed the connection)
2022-09-28 18:40:18 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-09-28 18:42:47 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 18:45:34 +0200 <EvanR> :q
2022-09-28 18:46:48 +0200yvan-sraka(~yvan-srak@2a02:2788:224:71c:b245:572d:f388:b75c)
2022-09-28 18:46:56 +0200waleee(~waleee@192.165.44.49)
2022-09-28 18:47:34 +0200slack1256(~slack1256@191.125.227.202)
2022-09-28 18:47:39 +0200nschoe(~quassel@2a01:e0a:8e:a190:8ad:294d:95c5:8589)
2022-09-28 18:49:51 +0200slac36995(~slack1256@186.11.98.128) (Ping timeout: 265 seconds)
2022-09-28 18:50:38 +0200nschoe(~quassel@2a01:e0a:8e:a190:8ad:294d:95c5:8589) (Client Quit)
2022-09-28 18:54:03 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Read error: Connection timed out)
2022-09-28 18:58:36 +0200waldo(~waldo@user/waldo)
2022-09-28 19:00:15 +0200akegalj(~akegalj@213-202-90-31.dsl.iskon.hr) (Quit: leaving)
2022-09-28 19:02:12 +0200fmgornick(~fmgornick@2607:ea00:107:3c07:1847:3a0a:5902:4b8e)
2022-09-28 19:02:20 +0200 <fmgornick> ?src scanl
2022-09-28 19:02:21 +0200 <lambdabot> scanl f q ls = q : case ls of
2022-09-28 19:02:21 +0200 <lambdabot> [] -> []
2022-09-28 19:02:21 +0200 <lambdabot> x:xs -> scanl f (f q x) xs
2022-09-28 19:02:46 +0200fmgornick(~fmgornick@2607:ea00:107:3c07:1847:3a0a:5902:4b8e) (Client Quit)
2022-09-28 19:03:52 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com)
2022-09-28 19:03:52 +0200wroathe(~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
2022-09-28 19:03:52 +0200wroathe(~wroathe@user/wroathe)
2022-09-28 19:09:45 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 19:18:08 +0200kawzeg_kawzeg
2022-09-28 19:18:47 +0200emmanuelux(~emmanuelu@2a01cb0000f3930028bb2a9bfdb59a78.ipv6.abo.wanadoo.fr)
2022-09-28 19:19:27 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 19:26:41 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Remote host closed the connection)
2022-09-28 19:30:47 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2022-09-28 19:30:51 +0200king_gs(~Thunderbi@2806:103e:29:5a6:d0be:f9c4:80c9:e8c5)
2022-09-28 19:31:12 +0200king_gs(~Thunderbi@2806:103e:29:5a6:d0be:f9c4:80c9:e8c5) (Client Quit)
2022-09-28 19:31:20 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Read error: Connection timed out)
2022-09-28 19:32:12 +0200marinelli[m]marinelli
2022-09-28 19:32:48 +0200marinellimarinelli[m]
2022-09-28 19:32:58 +0200coot(~coot@213.134.165.79) (Quit: coot)
2022-09-28 19:33:15 +0200ellensol(~ellen@178-78-210-152.customers.ownit.se) (Ping timeout: 268 seconds)
2022-09-28 19:35:11 +0200jakalx(~jakalx@base.jakalx.net) ()
2022-09-28 19:35:45 +0200marinelli[m](~marinelli@2001:470:69fc:105::2d8) (Quit: issued !quit command)
2022-09-28 19:40:26 +0200jakalx(~jakalx@base.jakalx.net)
2022-09-28 19:42:25 +0200Major_Biscuit(~MajorBisc@c-001-023-044.client.tudelft.eduvpn.nl) (Ping timeout: 252 seconds)
2022-09-28 19:42:39 +0200talismanick(~talismani@2601:200:c100:c9e0::24ac) (Ping timeout: 244 seconds)
2022-09-28 19:44:10 +0200Lycurgus(~juan@user/Lycurgus)
2022-09-28 19:46:03 +0200zeenk(~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f) (Quit: Konversation terminated!)
2022-09-28 19:46:45 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 19:47:46 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 246 seconds)
2022-09-28 19:48:26 +0200gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-09-28 19:50:59 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 248 seconds)
2022-09-28 19:51:12 +0200gmg(~user@user/gehmehgeh)
2022-09-28 19:53:14 +0200ardell(~ardell@user/ardell)
2022-09-28 19:56:53 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2022-09-28 20:01:35 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 20:02:17 +0200waleee(~waleee@192.165.44.49) (Ping timeout: 244 seconds)
2022-09-28 20:05:16 +0200fserucas(~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 246 seconds)
2022-09-28 20:06:38 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 268 seconds)
2022-09-28 20:09:26 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-28 20:10:27 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 20:13:15 +0200enoq(~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) (Quit: enoq)
2022-09-28 20:21:58 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 20:26:37 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 260 seconds)
2022-09-28 20:26:42 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-09-28 20:27:12 +0200mmhat(~mmh@p200300f1c7062304ee086bfffe095315.dip0.t-ipconnect.de)
2022-09-28 20:28:02 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2022-09-28 20:31:14 +0200ellensol(~ellen@ua-84-216-129-63.bbcust.telenor.se)
2022-09-28 20:31:18 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds)
2022-09-28 20:33:25 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 20:36:37 +0200waleee(~waleee@h-176-10-137-138.NA.cust.bahnhof.se)
2022-09-28 20:37:56 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 244 seconds)
2022-09-28 20:41:15 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 20:51:15 +0200yvan-sraka(~yvan-srak@2a02:2788:224:71c:b245:572d:f388:b75c) (Remote host closed the connection)
2022-09-28 20:52:57 +0200Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt juan@acm.org)
2022-09-28 20:53:26 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 244 seconds)
2022-09-28 20:56:18 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2022-09-28 20:56:40 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2022-09-28 20:56:59 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds)
2022-09-28 20:57:04 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 246 seconds)
2022-09-28 20:59:23 +0200Lord_of_Life_Lord_of_Life
2022-09-28 21:01:08 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 21:07:05 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 21:11:16 +0200hrberg(~quassel@171.79-160-161.customer.lyse.net)
2022-09-28 21:11:31 +0200pavonia(~user@user/siracusa)
2022-09-28 21:12:49 +0200zer0bitz(~zer0bitz@2001:2003:f748:2000:b409:b96f:ba06:b5f) (Ping timeout: 246 seconds)
2022-09-28 21:15:12 +0200talismanick(~talismani@96-67-197-217-static.hfc.comcastbusiness.net)
2022-09-28 21:21:54 +0200LukeHoersten(~LukeHoers@user/lukehoersten)
2022-09-28 21:23:51 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-28 21:24:32 +0200ubert(~Thunderbi@77.119.161.212.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
2022-09-28 21:25:07 +0200LukeHoersten(~LukeHoers@user/lukehoersten) (Client Quit)
2022-09-28 21:30:23 +0200ellensol(~ellen@ua-84-216-129-63.bbcust.telenor.se) (Read error: Connection reset by peer)
2022-09-28 21:31:20 +0200Kaiepi(~Kaiepi@142.68.249.28) (Remote host closed the connection)
2022-09-28 21:31:31 +0200 <dminuoso> sm: Not quite.
2022-09-28 21:31:44 +0200Kaiepi(~Kaiepi@142.68.249.28)
2022-09-28 21:32:36 +0200 <dminuoso> sm: What was quite cool about nested parsers, is that I could simply run: r <- lift $ runParserT principleFile' path txt
2022-09-28 21:32:58 +0200 <dminuoso> And the beauty is that I now have shared state and shared environment in the sub parser
2022-09-28 21:33:22 +0200 <dminuoso> https://gist.github.com/dminuoso/065e043d05cd601008729bc3c8198239
2022-09-28 21:33:24 +0200 <dminuoso> It's so simple
2022-09-28 21:33:52 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 21:34:51 +0200nate3(~nate@98.45.169.16)
2022-09-28 21:35:12 +0200Kaiepi(~Kaiepi@142.68.249.28) (Read error: Connection reset by peer)
2022-09-28 21:35:38 +0200Kaiepi(~Kaiepi@142.68.249.28)
2022-09-28 21:37:08 +0200slack1256(~slack1256@191.125.227.202) (Read error: Connection reset by peer)
2022-09-28 21:37:19 +0200slack1256(~slack1256@186.11.98.123)
2022-09-28 21:40:20 +0200nate3(~nate@98.45.169.16) (Ping timeout: 268 seconds)
2022-09-28 21:41:36 +0200ellensol(~ellen@ua-84-216-129-63.bbcust.telenor.se)
2022-09-28 21:42:24 +0200talismanick(~talismani@96-67-197-217-static.hfc.comcastbusiness.net) (Ping timeout: 265 seconds)
2022-09-28 21:52:10 +0200waldo(~waldo@user/waldo) (Quit: quit)
2022-09-28 21:53:24 +0200 <sm> dminuoso: lovely!
2022-09-28 21:54:56 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-09-28 21:55:33 +0200ft(~ft@p3e9bc57b.dip0.t-ipconnect.de)
2022-09-28 21:58:07 +0200mestre(~mestre@191.177.181.194)
2022-09-28 22:01:44 +0200gustik(~gustik@2a01:c844:2457:2220:475d:34f:d571:996f)
2022-09-28 22:01:51 +0200talismanick(~talismani@2601:200:c100:c9e0::24ac)
2022-09-28 22:15:07 +0200 <EvanR> > [quotRem a b | a <- [10, -10], b <- [3, -3]]
2022-09-28 22:15:10 +0200 <lambdabot> [(3,1),(-3,1),(-3,-1),(3,-1)]
2022-09-28 22:16:40 +0200 <EvanR> is negative rem negative always negative
2022-09-28 22:16:46 +0200 <EvanR> or zero
2022-09-28 22:20:20 +0200coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-09-28 22:20:32 +0200 <ski> > [[n `quotRem` d | d <- [-3,3]] | n <- [-10,10]]
2022-09-28 22:20:34 +0200 <lambdabot> [[(3,-1),(-3,-1)],[(-3,1),(3,1)]]
2022-09-28 22:21:17 +0200coot(~coot@213.134.165.79)
2022-09-28 22:24:54 +0200 <EvanR> i think yes because q*b is negative but can't exceed a in negativeness, so you sometimes need to subtract more
2022-09-28 22:29:23 +0200shapr(~user@68.54.166.125)
2022-09-28 22:30:04 +0200Midjak(~Midjak@82.66.147.146) (Read error: Connection reset by peer)
2022-09-28 22:30:35 +0200Midjak2(~Midjak@82.66.147.146)
2022-09-28 22:31:45 +0200coot(~coot@213.134.165.79) (Quit: coot)
2022-09-28 22:34:43 +0200 <EvanR> > ((-9223372036854775808) :: Int) `quotRem` (-1)
2022-09-28 22:34:44 +0200 <lambdabot> (*Exception: arithmetic overflow
2022-09-28 22:34:49 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2022-09-28 22:35:23 +0200 <EvanR> myth busted
2022-09-28 22:36:16 +0200 <EvanR> > ((-9223372036854775808) :: Int) `rem` (-1)
2022-09-28 22:36:17 +0200 <lambdabot> 0
2022-09-28 22:36:35 +0200 <EvanR> how in the
2022-09-28 22:38:45 +0200 <EvanR> is it not using cpu instruction IDIV
2022-09-28 22:42:13 +0200 <geekosaur> bah, play's down
2022-09-28 22:42:15 +0200 <int-e> EvanR: https://gitlab.haskell.org/ghc/ghc/-/blob/e0ded198e9ec1c8bb7253506569e7ae47818e791/libraries/base/…
2022-09-28 22:43:12 +0200 <int-e> EvanR: It really can't use idiv directly because that would crash the program.
2022-09-28 22:44:23 +0200 <EvanR> oh look at that shit
2022-09-28 22:44:35 +0200 <EvanR> > snd $ ((-9223372036854775808) :: Int) `quotRem` (-1)
2022-09-28 22:44:37 +0200 <lambdabot> 0
2022-09-28 22:44:39 +0200 <int-e> yeah it's not pretty at all.
2022-09-28 22:44:46 +0200 <EvanR> > fst $ ((-9223372036854775808) :: Int) `quotRem` (-1)
2022-09-28 22:44:48 +0200 <lambdabot> *Exception: arithmetic overflow
2022-09-28 22:48:48 +0200 <EvanR> > (error "!") `rem` (-1)
2022-09-28 22:48:50 +0200 <lambdabot> *Exception: !
2022-09-28 22:49:04 +0200 <EvanR> it's lazy sometimes
2022-09-28 22:50:05 +0200 <ski> > 5 `mod` 0
2022-09-28 22:50:07 +0200 <lambdabot> *Exception: divide by zero
2022-09-28 22:50:08 +0200 <ski> > 5 `rem` 0
2022-09-28 22:50:10 +0200 <lambdabot> *Exception: divide by zero
2022-09-28 22:50:11 +0200 <ski> alas !
2022-09-28 22:50:26 +0200 <ski> (imho, those ought to give `5')
2022-09-28 22:50:35 +0200 <ski> EvanR : i was hoping my example would dispel your confusion
2022-09-28 22:50:36 +0200 <EvanR> now for the crescendo
2022-09-28 22:50:50 +0200 <EvanR> > error "!" `rem` 0
2022-09-28 22:50:51 +0200 <lambdabot> *Exception: divide by zero
2022-09-28 22:51:10 +0200 <EvanR> what
2022-09-28 22:51:43 +0200 <ski> apparently it checks denominator first
2022-09-28 22:51:45 +0200 <ski> EvanR : anyway, with `divMod', the sign of the denominator controls the sign of the remainder. with `quotRem', the sign of the numerator controls the sign of the remainder
2022-09-28 22:51:59 +0200 <EvanR> the code for rem has a !a in the pattern
2022-09-28 22:54:26 +0200 <ski> > gcd 0 0 -- fwiw, this was fixed, some time ago
2022-09-28 22:54:27 +0200 <lambdabot> 0
2022-09-28 22:55:10 +0200ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-09-28 22:55:38 +0200 <EvanR> > let f !a b | b==0 = error "?" in f (error "!") 0
2022-09-28 22:55:40 +0200 <lambdabot> *Exception: !
2022-09-28 22:56:01 +0200 <EvanR> > let f !a b | b==0 = error "?" in f 3 0
2022-09-28 22:56:03 +0200 <lambdabot> *Exception: ?
2022-09-28 22:56:17 +0200 <EvanR> > rem (error "!") 0
2022-09-28 22:56:19 +0200 <lambdabot> *Exception: divide by zero
2022-09-28 22:56:25 +0200ChaiTRex(~ChaiTRex@user/chaitrex)
2022-09-28 22:56:36 +0200 <ski> EvanR : hm. i think the `!a' only guarantees the result will be bottom, in case the argument was bottom .. and that way the case, in your example. just a "different bottom" that you expected
2022-09-28 22:57:03 +0200 <ski> s/way/was/
2022-09-28 22:57:07 +0200rockymarine(~rocky@user/rockymarine) (Ping timeout: 252 seconds)
2022-09-28 22:57:08 +0200 <EvanR> so the bottoms sort of get in a hat and then one is selected
2022-09-28 22:57:14 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2022-09-28 22:57:17 +0200 <ski> yea
2022-09-28 22:57:48 +0200 <ski> i think i had some example where the bottom happened after the function had returned
2022-09-28 22:57:57 +0200 <EvanR> still I'm surprised to see the supposed code for rem evaluate !a "late" ?
2022-09-28 22:58:10 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2022-09-28 22:58:17 +0200 <ski> if you want more guarantees on evaluation order, you probably want `pseq'
2022-09-28 22:59:31 +0200 <geekosaur> pretty sure I've seen discussion of this by the ghc devs
2022-09-28 22:59:58 +0200 <sm> is there something like takeUntil in a standard-ish library ? I want one more element than takeWhile
2022-09-28 23:00:00 +0200 <geekosaur> (also pretty sure gcc does the same thing when it's a choice between two UBs)
2022-09-28 23:01:16 +0200 <ski> EvanR : anyway, the paper on imprecise exceptions mentions this
2022-09-28 23:01:46 +0200 <ski> (the "an arbitrary one is selected")
2022-09-28 23:01:53 +0200 <EvanR> yeah I knew that
2022-09-28 23:02:02 +0200nate3(~nate@98.45.169.16)
2022-09-28 23:03:31 +0200cyphase(~cyphase@user/cyphase) (Ping timeout: 248 seconds)
2022-09-28 23:05:19 +0200cyphase(~cyphase@user/cyphase)
2022-09-28 23:05:39 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-09-28 23:07:38 +0200Sgeo(~Sgeo@user/sgeo)
2022-09-28 23:07:55 +0200UnhammerdUnhammer
2022-09-28 23:08:37 +0200gmg(~user@user/gehmehgeh) (Quit: Leaving)
2022-09-28 23:09:36 +0200Sciencentistguy9(~sciencent@hacksoc/ordinary-member)
2022-09-28 23:10:50 +0200rockymarine(~rocky@user/rockymarine)
2022-09-28 23:11:48 +0200Sciencentistguy(~sciencent@hacksoc/ordinary-member) (Ping timeout: 264 seconds)
2022-09-28 23:11:48 +0200Sciencentistguy9Sciencentistguy
2022-09-28 23:13:19 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-09-28 23:15:26 +0200Midjak2(~Midjak@82.66.147.146) (Read error: Connection reset by peer)
2022-09-28 23:15:36 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-09-28 23:18:28 +0200ellensol(~ellen@ua-84-216-129-63.bbcust.telenor.se) (Ping timeout: 246 seconds)
2022-09-28 23:24:16 +0200TonyStone(~TonyStone@2603-7080-8607-c36a-cc48-2eb7-9785-f03a.res6.spectrum.com)
2022-09-28 23:28:36 +0200mmhat(~mmh@p200300f1c7062304ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2022-09-28 23:41:53 +0200mikoto-chan(~mikoto-ch@2001:999:250:8e97:e6cf:477a:ca0:6032)
2022-09-28 23:41:58 +0200mmhat(~mmh@p200300f1c70623c9ee086bfffe095315.dip0.t-ipconnect.de)
2022-09-28 23:43:25 +0200ellensol(~ellen@ua-84-216-129-63.bbcust.telenor.se)
2022-09-28 23:44:00 +0200michalz(~michalz@185.246.207.215) (Remote host closed the connection)
2022-09-28 23:45:09 +0200acidjnk_new(~acidjnk@p200300d6e7137a441827c7a2ee98ef4a.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
2022-09-28 23:50:21 +0200mikoto-chan(~mikoto-ch@2001:999:250:8e97:e6cf:477a:ca0:6032) (Ping timeout: 250 seconds)
2022-09-28 23:50:37 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk)
2022-09-28 23:52:11 +0200mikoto-chan(~mikoto-ch@85-76-146-167-nat.elisa-mobile.fi)
2022-09-28 23:52:16 +0200ec_ec
2022-09-28 23:52:58 +0200eggplantade(~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2022-09-28 23:53:08 +0200titibandit(~titibandi@xdsl-212-8-150-57.nc.de) (Remote host closed the connection)
2022-09-28 23:55:07 +0200burnsidesLlama(~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 250 seconds)