Logs on 2022-09-28 (liberachat/#haskell)
| 00:03:29 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 00:04:14 | <ski> | zzz : it's `infixl' |
| 00:04:54 | <ski> | > Node {rootLabel = (),subForest = []} {subForest = [Node {rootLabel = (),subForest = []}]} |
| 00:04:56 | <lambdabot> | Node {rootLabel = (), subForest = [Node {rootLabel = (), subForest = []}]} |
| 00:05:54 | <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 |
| 00:05:55 | <lambdabot> | Node {rootLabel = (), subForest = []} |
| 00:07:57 | <ski> | > let Node {rootLabel = r,..} {subForest = f} = Node {rootLabel = r,subForest = []} in (r,f) |
| 00:07:59 | <lambdabot> | <hint>:1:5: error: |
| 00:07:59 | <lambdabot> | Not a record constructor: Node {rootLabel = r, ..} |
| 00:08:00 | <ski> | > let f Node {rootLabel = r,..} {subForest = f} = (r,f) in f Node {rootLabel = r,subForest = []} |
| 00:08:02 | <lambdabot> | <hint>:1:7: error: |
| 00:08:02 | <lambdabot> | Not a record constructor: Node {rootLabel = r, ..} |
| 00:08:08 | <ski> | no update syntax in patterns, though ^ |
| 00:08:47 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 00:09:14 | <ski> | data Tree a = Node {rootLabel :: a,subForest :: [Tree a]} -- for completeness |
| 00:10:33 | <talismanick> | Let's say O |
| 00:11:07 | <talismanick> | I'm writing a program which writes to files (assume POSIX fs for simplicity) but only appending or creating |
| 00:11:17 | <talismanick> | let's say I'm writing* |
| 00:11:53 | <talismanick> | Is there a more modular library than Turtle, Shelly, etc which gives me atomicity guarantees? |
| 00:12:44 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds) |
| 00:13:32 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 00:13:56 | <talismanick> | or, is persistent STM (PSTM) already usable? |
| 00:18:58 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 00:20:26 | × | yobson_ quits (~yobson@mail.jotron.com) (Ping timeout: 260 seconds) |
| 00:20:28 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 00:21:33 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 00:23:48 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 264 seconds) |
| 00:24:49 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 265 seconds) |
| 00:28:47 | × | redmp quits (~redmp@mobile-166-177-251-115.mycingular.net) (Ping timeout: 252 seconds) |
| 00:31:27 | → | zmt01 joins (~zmt00@user/zmt00) |
| 00:31:40 | <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-contribute-to-stackoverflow/> |
| 00:31:55 | × | zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 244 seconds) |
| 00:32:05 | <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++/ |
| 00:32:11 | <ski> | @where on-functors |
| 00:32:12 | <lambdabot> | "On Functors" (in C++,Standard ML,Haskell,Prolog) by Peteris Krumins in 2010-05-17 at <http://www.catonmat.net/blog/on-functors/> |
| 00:32:23 | <sm> | dumb answer: creating/appending are just naturally atomic ?talismanick |
| 00:32:31 | → | yobson_ joins (~yobson@mail.jotron.com) |
| 00:32:56 | <ski> | iirc Prolog got the word from symbolic logic, which got the name from philosophy (like Carnap) |
| 00:33:25 | <ski> | talismanick : btw, you've heard that uniqueness is sortof the opposite of linearity, yes ? |
| 00:34:14 | <talismanick> | ski: As a matter of fact, I do feel like I've read that somewhere |
| 00:34:41 | <talismanick> | but, if I'm being honest, it's as well as if I hadn't, because I'm not sure I understand |
| 00:35:20 | <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)) |
| 00:36:03 | <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 |
| 00:37:04 | × | yobson_ quits (~yobson@mail.jotron.com) (Ping timeout: 244 seconds) |
| 00:37:21 | <talismanick> | ski: it can be duplicated/discarded in the future? |
| 00:37:31 | <ski> | yes |
| 00:37:34 | <ski> | however |
| 00:38:03 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 00:38:26 | <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 |
| 00:38:26 | <talismanick> | Is there a transformation which takes it from unique to regular, dual to the transformation which takes regular to linear? |
| 00:38:54 | <talismanick> | ah, I see |
| 00:39:39 | <talismanick> | what goes in, must come out if you pull something out and there isn't anything else |
| 00:39:51 | <ski> | this is how `Start :: *World -> *World' in Clean works. also `:- mode main(io.state :: unique >> dead,io.state :: free >> unique).' (iirc) in Mercury |
| 00:40:28 | <talismanick> | Yeah, !IO is sugar for IO1,IO2 in one side-effecting call, then IO2, IO3 in the next |
| 00:40:45 | <talismanick> | and the top level is IO1, IOn in the head |
| 00:40:46 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 00:41:00 | <ski> | well, yes, you can use the state-variable notation (or DCG notation). that's orthogonal to the typing aspects, though |
| 00:41:05 | <talismanick> | IO0, if we're using the same number scheme |
| 00:41:10 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 00:42:49 | <EvanR> | realworld is deeply magical. It is primitive but it is not unlifted |
| 00:43:58 | <talismanick> | Hm, looked it up and found https://granule-project.github.io/papers/esop22-paper.pdf |
| 00:44:08 | <talismanick> | Another paper on the "to read" heap |
| 00:44:58 | <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> |
| 00:46:38 | <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) |
| 00:47:17 | <talismanick> | ski: "the" Linear Haskell paper? |
| 00:47:48 | <talismanick> | Am actually a bit lost on which one is a canonical reference for what exists now |
| 00:48:57 | <ski> | i only have a vague recollection of something like that, may be misremembering, or misrepresenting the scope of it |
| 00:49:20 | → | yobson joins (~yobson@mail.jotron.com) |
| 00:57:13 | × | cyphase quits (~cyphase@user/cyphase) (Ping timeout: 244 seconds) |
| 01:00:09 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 01:00:31 | <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) |
| 01:02:05 | → | cyphase joins (~cyphase@user/cyphase) |
| 01:08:23 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds) |
| 01:08:23 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 01:11:58 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 01:12:04 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 01:22:42 | × | xff0x quits (~xff0x@2405:6580:b080:900:a11c:672e:e426:9fe0) (Ping timeout: 268 seconds) |
| 01:31:11 | → | nate3 joins (~nate@98.45.169.16) |
| 01:34:31 | × | beteigeuze quits (~Thunderbi@2001:8a0:61b5:6101:f0c:e4e3:bfdc:91df) (Ping timeout: 260 seconds) |
| 01:34:48 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 01:35:53 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
| 01:36:29 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 244 seconds) |
| 01:42:42 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 01:47:21 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 260 seconds) |
| 01:52:33 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 01:53:12 | × | yobson quits (~yobson@mail.jotron.com) (Ping timeout: 264 seconds) |
| 01:55:12 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 265 seconds) |
| 02:05:07 | → | yobson joins (~yobson@mail.jotron.com) |
| 02:07:51 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 258 seconds) |
| 02:08:36 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 02:08:48 | → | xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
| 02:09:39 | × | yobson quits (~yobson@mail.jotron.com) (Ping timeout: 248 seconds) |
| 02:15:59 | × | td_ quits (~td@muedsl-82-207-238-071.citykom.de) (Ping timeout: 265 seconds) |
| 02:17:34 | → | td_ joins (~td@muedsl-82-207-238-028.citykom.de) |
| 02:20:33 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer) |
| 02:22:19 | → | yobson joins (~yobson@mail.jotron.com) |
| 02:23:25 | × | jmorris quits (uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
| 02:26:25 | → | dcoutts__ joins (~duncan@host86-177-125-45.range86-177.btcentralplus.com) |
| 02:26:26 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 02:26:48 | × | yobson quits (~yobson@mail.jotron.com) (Ping timeout: 264 seconds) |
| 02:27:13 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 02:28:40 | × | dcoutts_ quits (~duncan@host86-151-44-255.range86-151.btcentralplus.com) (Ping timeout: 244 seconds) |
| 02:32:00 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 258 seconds) |
| 02:34:18 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 02:38:05 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 02:39:53 | → | yobson joins (~yobson@mail.jotron.com) |
| 02:43:14 | → | nate3 joins (~nate@98.45.169.16) |
| 02:43:38 | × | dolio quits (~dolio@130.44.130.54) (Quit: ZNC 1.8.2 - https://znc.in) |
| 02:46:41 | → | dolio joins (~dolio@130.44.130.54) |
| 02:47:02 | × | dolio quits (~dolio@130.44.130.54) (Remote host closed the connection) |
| 02:48:26 | × | mzan quits (~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 02:48:45 | → | dolio joins (~dolio@130.44.130.54) |
| 02:48:56 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::778c) (Ping timeout: 268 seconds) |
| 02:49:29 | → | mzan joins (~quassel@mail.asterisell.com) |
| 02:51:55 | → | rburkholder joins (~blurb@96.45.2.121) |
| 02:53:02 | → | luffy joins (~chenqisu1@183.217.201.156) |
| 02:58:38 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Read error: Connection timed out) |
| 03:06:02 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 03:12:57 | × | jero98772 quits (~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) (Remote host closed the connection) |
| 03:24:15 | → | frost joins (~frost@user/frost) |
| 03:28:52 | × | slac53815 quits (~slack1256@186.11.109.251) (Ping timeout: 246 seconds) |
| 03:37:06 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 03:44:06 | × | yobson quits (~yobson@mail.jotron.com) (Ping timeout: 244 seconds) |
| 03:45:44 | × | Vajb quits (~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57) (Read error: Connection reset by peer) |
| 03:46:03 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 03:51:57 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 03:52:10 | → | Vajb joins (~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57) |
| 03:53:23 | × | luffy quits (~chenqisu1@183.217.201.156) (Ping timeout: 252 seconds) |
| 03:54:29 | × | bilegeek quits (~bilegeek@2600:1008:b058:58ea:bed4:5c49:4f66:54ee) (Quit: Leaving) |
| 03:54:38 | × | frost quits (~frost@user/frost) (Quit: Ping timeout (120 seconds)) |
| 03:55:45 | → | yobson joins (~yobson@mail.jotron.com) |
| 04:00:24 | × | yobson quits (~yobson@mail.jotron.com) (Ping timeout: 265 seconds) |
| 04:00:38 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds) |
| 04:04:10 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 04:11:56 | → | yobson_ joins (~yobson@mail.jotron.com) |
| 04:18:58 | → | nate3 joins (~nate@98.45.169.16) |
| 04:19:25 | × | yobson_ quits (~yobson@mail.jotron.com) (Ping timeout: 252 seconds) |
| 04:19:57 | → | yobson_ joins (~yobson@mail.jotron.com) |
| 04:21:57 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 04:23:10 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 258 seconds) |
| 04:24:33 | × | yobson_ quits (~yobson@mail.jotron.com) (Ping timeout: 265 seconds) |
| 04:26:36 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 260 seconds) |
| 04:27:27 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 265 seconds) |
| 04:27:34 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 04:36:00 | → | yobson joins (~yobson@mail.jotron.com) |
| 04:40:19 | × | yobson quits (~yobson@mail.jotron.com) (Ping timeout: 252 seconds) |
| 04:44:02 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 04:46:09 | → | dontdieych joins (~quassel@146.56.130.54) |
| 04:52:15 | → | yobson joins (~yobson@mail.jotron.com) |
| 05:03:15 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 05:07:26 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 260 seconds) |
| 05:09:52 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 05:10:46 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 05:19:13 | × | remexre quits (~remexre@user/remexre) (Remote host closed the connection) |
| 05:19:16 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Remote host closed the connection) |
| 05:19:22 | → | matthewmosior joins (~matthewmo@173.170.253.91) |
| 05:19:51 | × | matthewmosior quits (~matthewmo@173.170.253.91) (Client Quit) |
| 05:19:56 | → | gmg joins (~user@user/gehmehgeh) |
| 05:20:35 | → | remexre joins (~remexre@user/remexre) |
| 05:28:54 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 05:30:21 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 05:34:00 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 05:38:15 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds) |
| 05:41:13 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 05:42:10 | → | gmg joins (~user@user/gehmehgeh) |
| 05:43:52 | → | chexum_ joins (~quassel@gateway/tor-sasl/chexum) |
| 05:44:49 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 258 seconds) |
| 05:57:24 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 05:58:24 | × | stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 05:59:09 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Client Quit) |
| 05:59:12 | → | stiell_ joins (~stiell@gateway/tor-sasl/stiell) |
| 06:00:54 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 06:07:18 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 06:07:57 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 06:10:00 | × | cyphase quits (~cyphase@user/cyphase) (Ping timeout: 264 seconds) |
| 06:12:31 | × | yobson quits (~yobson@mail.jotron.com) (Remote host closed the connection) |
| 06:12:43 | → | yobson joins (~yobson@mail.jotron.com) |
| 06:14:30 | → | cyphase joins (~cyphase@user/cyphase) |
| 06:14:53 | → | kenran joins (~user@user/kenran) |
| 06:16:45 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 252 seconds) |
| 06:19:18 | → | rockymarine joins (~rocky@user/rockymarine) |
| 06:21:07 | → | lottaquestions joins (~nick@2607:fa49:503e:7100:fd11:b240:caa3:7177) |
| 06:22:43 | × | lottaquestions_ quits (~nick@2607:fa49:503e:7100:7430:a788:fee1:3622) (Ping timeout: 244 seconds) |
| 06:24:03 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 248 seconds) |
| 06:27:23 | → | rockymarine joins (~rocky@user/rockymarine) |
| 06:29:54 | → | michalz joins (~michalz@185.246.207.215) |
| 06:34:53 | → | zeenk joins (~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f) |
| 06:46:42 | × | chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
| 06:48:13 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 06:48:53 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Remote host closed the connection) |
| 06:49:25 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 06:53:13 | → | Sose joins (~sose@mobile-access-567367-206.dhcp.inet.fi) |
| 06:54:08 | <phma> | https://hackage.haskell.org/package/random-ladder-0.1.0.0/candidate |
| 06:54:15 | QNX | is now known as EnchanterTim |
| 06:54:30 | <phma> | this is my first package candidate. could someone look at it? |
| 06:54:59 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 06:55:17 | → | titibandit joins (~titibandi@xdsl-212-8-150-57.nc.de) |
| 06:56:20 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Ping timeout: 265 seconds) |
| 06:57:50 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 06:59:22 | × | jargon quits (~jargon@184.101.186.15) (Remote host closed the connection) |
| 07:03:04 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds) |
| 07:03:32 | × | david quits (~david@2a01:e34:ec2b:d430:44a:f5ca:9867:d69d) (Read error: Connection reset by peer) |
| 07:15:49 | → | jonathanx joins (~jonathan@h-98-128-168-222.NA.cust.bahnhof.se) |
| 07:16:31 | → | fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 07:16:48 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 07:17:16 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:445e:b42c:e761:f5db) |
| 07:21:48 | → | MajorBiscuit joins (~MajorBisc@2a02-a461-129d-1-193d-75d8-745d-e91e.fixed6.kpn.net) |
| 07:23:10 | → | jargon joins (~jargon@184.101.186.15) |
| 07:30:21 | → | nate3 joins (~nate@98.45.169.16) |
| 07:30:30 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 07:31:26 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 244 seconds) |
| 07:32:01 | → | rockymarine joins (~rocky@user/rockymarine) |
| 07:32:11 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 07:32:29 | → | chomwitt joins (~chomwitt@2a02:587:dc14:f500:278:be15:4a20:8304) |
| 07:33:24 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 264 seconds) |
| 07:35:28 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 265 seconds) |
| 07:36:06 | → | ubert joins (~Thunderbi@77.119.161.212.wireless.dyn.drei.com) |
| 07:38:02 | → | acidjnk joins (~acidjnk@p200300d6e7137a1628fe4ecf7cec9dba.dip0.t-ipconnect.de) |
| 07:43:46 | <pavonia> | Looks interesting (though I have no idea how it works) |
| 07:47:34 | × | yobson quits (~yobson@mail.jotron.com) (Quit: Leaving...) |
| 07:47:58 | <dminuoso> | Favourite newtype of the day: newtype DList a = DList { unDList :: [a] -> [a] } |
| 07:50:00 | <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. |
| 07:52:18 | → | beteigeuze joins (~Thunderbi@bl14-81-220.dsl.telepac.pt) |
| 07:52:43 | <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 |
| 07:53:06 | → | Major_Biscuit joins (~MajorBisc@c-001-023-044.client.tudelft.eduvpn.nl) |
| 07:53:25 | <dminuoso> | I do not think there exists a pragma to transitively say "do not simplify this code transitively" |
| 07:54:06 | <dminuoso> | Honestly, a more pragmatic solution to doing cryptographic computation, is to FFI into an established and peer reviewed C library |
| 07:54:07 | → | frost joins (~frost@user/frost) |
| 07:54:39 | <dminuoso> | e.g. using OpenSSL EC |
| 07:56:19 | × | MajorBiscuit quits (~MajorBisc@2a02-a461-129d-1-193d-75d8-745d-e91e.fixed6.kpn.net) (Ping timeout: 248 seconds) |
| 07:56:36 | <phma> | What do you mean by "let-floated"? |
| 07:56:39 | <dminuoso> | Besides, judging from a skim at your code I do not think you will benefit from "random guarantees" |
| 07:57:15 | ← | ay parts (Andrew@user/AndrewYu) (WeeChat 3.7-dev) |
| 07:58:00 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 07:58:04 | <dminuoso> | phma: a let-binding can sometimes be moved around into or out of things |
| 07:58:21 | <dminuoso> | This can facilitate extra sharing or inlining |
| 07:58:58 | <dminuoso> | Your biggest enemy in cryptographic computation is compiler optimizations and hardware accelerations (non-constant machine instructions and caching) |
| 07:59:04 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 07:59:04 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 07:59:15 | <dminuoso> | (That is, if you use an established constant-time algorithm to begin with) |
| 07:59:32 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 07:59:32 | <dminuoso> | (Oh, and things like super scalar execution are nightmarish too) |
| 07:59:48 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 08:00:11 | <dminuoso> | phma: and by the way, I do not think your implementation is really "random". its computation behavior is deterministic. |
| 08:00:29 | <dminuoso> | I would like to see a peer-reviewed publication on your strategry. |
| 08:00:29 | <phma> | the random number comes from outside |
| 08:03:16 | <dminuoso> | phma: fair enough, but even the rest of the implementation should be looked at very closely. |
| 08:03:33 | <dminuoso> | i.e. does this leak secrets into CPU cache? |
| 08:03:41 | <phma> | The argument "random" to randomLadder should be picked at random. It determines the order of operations, without affecting the result. |
| 08:06:08 | × | Sose quits (~sose@mobile-access-567367-206.dhcp.inet.fi) (Quit: Leaving) |
| 08:06:10 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 08:12:43 | × | jargon quits (~jargon@184.101.186.15) (Remote host closed the connection) |
| 08:13:46 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 246 seconds) |
| 08:14:20 | <phma> | dminuoso: I sent it to Sam Wagstaff. He likes it, though he doesn't know Haskell. |
| 08:15:28 | <phma> | I took his crypto class the first year he was at Purdue, replacing Dorothy Denning, who wrote the book. |
| 08:15:51 | × | shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit) |
| 08:18:47 | <phma> | Montgomery wentletrap |
| 08:20:15 | <[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 |
| 08:26:47 | <phma> | it isn't introducing random delays, it's choosing a random sequence of operations that multiplies by the given number |
| 08:27:22 | <dminuoso> | The real concern is the ladder itself at the end. |
| 08:27:56 | <dminuoso> | After the simplifier is done, who is to say that you will be leaking bits out via timing *despite* a random ladder. |
| 08:28:05 | <dminuoso> | Or via cache |
| 08:29:18 | × | TonyStone quits (~TonyStone@2603-7080-8607-c36a-cc48-2eb7-9785-f03a.res6.spectrum.com) (Ping timeout: 244 seconds) |
| 08:31:07 | <phma> | How can I try a timing or cache attack on the random ladder? |
| 08:31:08 | → | waldo joins (~waldo@user/waldo) |
| 08:31:23 | <dminuoso> | By spending a lot of analysis on the generated core and machine code. |
| 08:31:59 | <dminuoso> | phma: The usual method is the Feynman algorithm. |
| 08:33:47 | <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? |
| 08:34:05 | <dminuoso> | https://wiki.c2.com/?FeynmanAlgorithm |
| 08:34:21 | <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. |
| 08:34:40 | <dminuoso> | Im not saying this is the case, but perhaps you can see how just picking a random ladder path might not be enough. |
| 08:35:14 | <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? |
| 08:35:30 | <dminuoso> | sm: foldrM with Either? |
| 08:38:27 | <dminuoso> | That is, `Either [Int] Int` where you keep the sum on the Right side, and throw a Left with the solution |
| 08:39:03 | <sm> | Thanks! I'll look into this (or foldlM) |
| 08:39:23 | → | cfricke joins (~cfricke@user/cfricke) |
| 08:39:42 | <sm> | nifty solution |
| 08:41:07 | × | acidjnk quits (~acidjnk@p200300d6e7137a1628fe4ecf7cec9dba.dip0.t-ipconnect.de) (Ping timeout: 248 seconds) |
| 08:43:10 | × | ubert quits (~Thunderbi@77.119.161.212.wireless.dyn.drei.com) (Read error: Connection reset by peer) |
| 08:43:31 | → | ubert joins (~Thunderbi@77.119.161.212.wireless.dyn.drei.com) |
| 08:45:06 | <sm> | is this essentially monadic, so requiring an M function ? |
| 08:50:34 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.6) |
| 08:50:43 | → | cfricke joins (~cfricke@user/cfricke) |
| 08:51:53 | → | acidjnk joins (~acidjnk@p200300d6e7137a161827c7a2ee98ef4a.dip0.t-ipconnect.de) |
| 08:52:22 | <dminuoso> | :t foldrM |
| 08:52:23 | <lambdabot> | (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b |
| 08:53:47 | × | ft quits (~ft@p3e9bc57b.dip0.t-ipconnect.de) (Quit: leaving) |
| 08:56:04 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
| 08:57:24 | <sm> | I mean is the problem monadic in essence ? or just something that requires an accumulator and short circuiting |
| 08:58:09 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 08:58:59 | <sm> | also, wouldn't I want foldlM here ? I want to scan just the first n elements |
| 09:00:31 | → | faultline joins (~christian@200116b82b5e1c0064b924bb43bde4ee.dip.versatel-1u1.de) |
| 09:03:23 | <dminuoso> | Right. |
| 09:03:45 | <dminuoso> | Well shortcircuiting is a monadic effect |
| 09:03:53 | <dminuoso> | That doesnt mean you need to explicitly go through >>= of course |
| 09:04:01 | <dminuoso> | I would probably just write a simple manual loop |
| 09:04:13 | → | kuribas joins (~user@silversquare.silversquare.eu) |
| 09:04:27 | <[Leary]> | > (\t l -> snd <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (inits l))) 20 [1..] |
| 09:04:29 | <lambdabot> | Just [1,2,3,4,5,6] |
| 09:04:35 | <[Leary]> | Or something like this. ^ |
| 09:05:55 | <sm> | yeah that would have been sensible, but we have all these wonderful tools. Thanks dminuoso, upgraded my haskell fu today |
| 09:06:41 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 09:06:54 | <sm> | [Leary]++ |
| 09:08:49 | <dminuoso> | Mmm, I like [Leary]'s version more. Though I would write it less dense. |
| 09:10:59 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 248 seconds) |
| 09:12:22 | → | chele joins (~chele@user/chele) |
| 09:12:30 | → | mastarija joins (~mastarija@2a05:4f46:e03:6000:328e:3c75:e042:cc19) |
| 09:13:16 | × | faultline quits (~christian@200116b82b5e1c0064b924bb43bde4ee.dip.versatel-1u1.de) (Remote host closed the connection) |
| 09:13:29 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 252 seconds) |
| 09:13:47 | <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 |
| 09:13:58 | × | dr_merijn quits (~dr_merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
| 09:14:12 | <dminuoso> | scanl feels more idiomatic though |
| 09:14:29 | <sm> | and brain cycles, for me and future me |
| 09:15:14 | <sm> | I might try a haskell while |
| 09:15:14 | <sm> | loop, I guess we have those |
| 09:15:23 | <[exa]> | y we no lenses for this |
| 09:16:02 | → | sagax joins (~sagax_nb@user/sagax) |
| 09:16:33 | <kuribas> | what does that do? |
| 09:17:00 | <kuribas> | inits has O(n^2) complexity |
| 09:18:00 | <[exa]> | kuribas: not if you don't consume the output |
| 09:18:28 | <kuribas> | [exa]: ah right |
| 09:18:36 | <kuribas> | @src inits |
| 09:18:36 | <lambdabot> | inits [] = [[]] |
| 09:18:36 | <lambdabot> | inits (x:xs) = [[]] ++ map (x:) (inits xs) |
| 09:19:30 | <kuribas> | why [[]] and not ([]:) |
| 09:19:43 | <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? |
| 09:20:51 | <kuribas> | sm: you can always write a tail recursive loop in haskell. |
| 09:21:05 | <kuribas> | sm: which is equivalent to what you would write in php/python |
| 09:21:32 | <Axman6> | src is almost always not what is actually used |
| 09:22:18 | → | rockymarine joins (~rocky@user/rockymarine) |
| 09:25:47 | <kuribas> | > scanl (:) [] [1..] |
| 09:25:50 | <lambdabot> | error: |
| 09:25:50 | <lambdabot> | • Occurs check: cannot construct the infinite type: a ~ [a] |
| 09:25:50 | <lambdabot> | Expected type: [a] -> [a] -> [a] |
| 09:25:58 | <kuribas> | > scanl (flip (:)) [] [1..] |
| 09:26:00 | <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... |
| 09:27:12 | <kuribas> | > (\t l -> reverse . snd <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l)) 20 [1..] |
| 09:27:14 | <lambdabot> | <hint>:1:101: error: |
| 09:27:14 | <lambdabot> | parse error (possibly incorrect indentation or mismatched brackets) |
| 09:27:17 | × | waldo quits (~waldo@user/waldo) (Quit: quit) |
| 09:28:45 | <kuribas> | > let t = 20; l = [1..] in reverse . snd <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l)) 20 [1..] |
| 09:28:49 | <lambdabot> | error: |
| 09:28:49 | <lambdabot> | • Couldn't match expected type ‘t0 -> [a3] -> f (a0, [a])’ |
| 09:28:49 | <lambdabot> | with actual type ‘Maybe (a1, [a2])’ |
| 09:32:44 | → | luffy joins (~chenqisu1@183.217.201.220) |
| 09:33:57 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 09:35:52 | <ph88^> | if i have ghc-options -with-rtsopts and then the user specifies his own rtsopts do the overwrite or supplement already set options ? |
| 09:36:34 | → | waldo joins (~waldo@user/waldo) |
| 09:40:51 | → | dr_merijn joins (~dr_merijn@86-86-29-250.fixed.kpn.net) |
| 09:41:34 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 09:41:40 | → | notzmv joins (~zmv@user/notzmv) |
| 09:44:09 | <kuribas> | > let t = 20; l = [1..] in (reverse . snd) <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l)) 20 [1..] |
| 09:44:12 | <lambdabot> | error: |
| 09:44:12 | <lambdabot> | • Couldn't match expected type ‘t0 -> [a3] -> f (a0, [a])’ |
| 09:44:12 | <lambdabot> | with actual type ‘Maybe (a1, [a2])’ |
| 09:44:44 | <ph88^> | kuribas, what voodoo is that |
| 09:45:04 | × | frost quits (~frost@user/frost) (Ping timeout: 252 seconds) |
| 09:45:33 | × | stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 258 seconds) |
| 09:49:36 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds) |
| 09:49:51 | → | stiell_ joins (~stiell@gateway/tor-sasl/stiell) |
| 09:50:27 | × | talismanick quits (~talismani@2601:200:c100:c9e0::24ac) (Ping timeout: 248 seconds) |
| 09:51:54 | <byorgey> | kuribas: you just need to remove the 20 [1..] from the end, I think |
| 09:52:10 | <kuribas> | > let t = 20; l = [1..] in (reverse . snd) <$> find ((>=t) . fst) (zip (scanl (+) 0 l) (scanl (flip (:)) [] l)) |
| 09:52:12 | <lambdabot> | Just [1,2,3,4,5,6] |
| 09:52:17 | <kuribas> | byorgey: thanks! |
| 09:52:23 | <byorgey> | \o/ |
| 09:52:39 | <kuribas> | > map reverse (scanl (flip (:)) [] l) |
| 09:52:41 | <lambdabot> | error: |
| 09:52:41 | <lambdabot> | • Couldn't match expected type ‘[a]’ with actual type ‘Expr’ |
| 09:52:41 | <lambdabot> | • In the third argument of ‘scanl’, namely ‘l’ |
| 09:52:51 | <kuribas> | > map reverse (scanl (flip (:)) [] [1..]) |
| 09:52:53 | <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... |
| 09:53:31 | <byorgey> | > inits [1..] |
| 09:53:33 | <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... |
| 09:54:35 | <byorgey> | oh, I see, you were talking about how inits takes quadratic time |
| 09:54:39 | <kuribas> | byorgey: I find the lazyness more obvious than in the @src definition. |
| 09:54:40 | <kuribas> | yeah |
| 09:56:39 | → | thyriaen joins (~thyriaen@2a02:8109:8340:686c:7383:e0e2:ad95:9fce) |
| 10:04:56 | × | xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 268 seconds) |
| 10:08:23 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 10:09:13 | → | lyle joins (~lyle@104.246.145.85) |
| 10:12:09 | × | titibandit quits (~titibandi@xdsl-212-8-150-57.nc.de) (Quit: Leaving.) |
| 10:12:47 | × | luffy quits (~chenqisu1@183.217.201.220) (Quit: Leaving) |
| 10:13:04 | → | luffy joins (~chenqisu1@183.217.201.220) |
| 10:14:16 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 10:15:21 | × | luffy quits (~chenqisu1@183.217.201.220) (Remote host closed the connection) |
| 10:15:24 | <ph88^> | kuribas, what have you just found out ? isn't it easier to just do [1..6] ? |
| 10:15:54 | → | luffy joins (~chenqisu1@183.217.201.220) |
| 10:16:15 | × | forell quits (~forell@user/forell) (Ping timeout: 244 seconds) |
| 10:16:41 | <kuribas> | ph88^: I found out that inits is linear what taking a single element. |
| 10:20:04 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 10:23:08 | → | forell joins (~forell@user/forell) |
| 10:25:25 | × | kuribas quits (~user@silversquare.silversquare.eu) (Quit: ERC (IRC client for Emacs 26.3)) |
| 10:27:47 | → | Midjak joins (~Midjak@82.66.147.146) |
| 10:31:46 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 10:34:28 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 10:36:44 | → | jco joins (~jco@90-228-194-139-no542.tbcn.telia.com) |
| 10:38:45 | → | moonsheep joins (~user@user/moonsheep) |
| 10:39:16 | <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? |
| 10:39:32 | <moonsheep> | specifically, cryptonite's Ed25519 PublicKey |
| 10:39:51 | <moonsheep> | I want to make a map of PublicKeys but for that I need it to be an instance of Ord |
| 10:40:06 | <moonsheep> | unfortunately, the constructor of PublicKey is not exported by the module, so I can't standalone derive it |
| 10:40:10 | <moonsheep> | any ideas? |
| 10:44:16 | → | frost joins (~frost@user/frost) |
| 10:45:29 | <[Leary]> | moonsheep: If the number of keys will never be too large, consider just using an alist. |
| 10:46:15 | <[Leary]> | Otherwise I'd write an Ord instance by hand for a newtype over PublicKey. |
| 10:46:54 | <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 |
| 10:46:55 | × | darkstardevx quits (~darkstard@192.183.207.94) (Ping timeout: 268 seconds) |
| 10:47:06 | <moonsheep> | as for the alist, I'll probably have to do that |
| 10:47:37 | <moonsheep> | I don't intend that have a large number of keys but not using a map somehow feels... wrong |
| 10:47:52 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 10:48:01 | <[Leary]> | moonsheep: You might be able to get away with, e.g. `compare = comparing show`. |
| 10:48:20 | <moonsheep> | oh damn |
| 10:48:31 | <moonsheep> | that's naughty |
| 10:49:11 | <moonsheep> | so, in summary, is there no better way without patching cryptonite? |
| 10:50:36 | → | pretty_dumm_guy joins (~trottel@eduroam-134-96-204-15.uni-saarland.de) |
| 10:51:45 | × | pretty_dumm_guy quits (~trottel@eduroam-134-96-204-15.uni-saarland.de) (Client Quit) |
| 10:51:49 | <[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. |
| 10:52:43 | <[Leary]> | Though I guess that would need IO... |
| 10:52:49 | <moonsheep> | yeah I wanted to avoid that |
| 10:52:59 | <moonsheep> | I'm not really comfortable around Ptrs |
| 10:53:09 | <[Leary]> | So yeah, I doubt you can do much better from the outside. |
| 10:53:30 | <moonsheep> | hmm right thanks |
| 10:53:42 | <moonsheep> | I guess I'll just do the showing thing for now, as a temporary measure |
| 10:54:03 | <moonsheep> | I still want to Ord and Serialize them though, so might have to get a custom cryptonite |
| 10:55:17 | → | waleee joins (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) |
| 10:58:43 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds) |
| 10:59:17 | × | waldo quits (~waldo@user/waldo) (Ping timeout: 268 seconds) |
| 10:59:30 | → | enoq joins (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) |
| 11:00:14 | → | xff0x joins (~xff0x@ai071162.d.east.v6connect.net) |
| 11:00:46 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 11:01:20 | × | rembo10 quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in) |
| 11:01:48 | <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 |
| 11:01:50 | <enoq> | traverse the list to a Maybe List and then reduce the list? |
| 11:03:52 | → | rembo10 joins (~rembo10@main.remulis.com) |
| 11:04:11 | → | Joao003 joins (~Joao003@187.85.87.1) |
| 11:04:42 | <lortabac> | > sequenceA [Just 1, Just 2] |
| 11:04:44 | <lambdabot> | Just [1,2] |
| 11:05:02 | <lortabac> | > sum <$> sequenceA [Just 1, Just 2] |
| 11:05:05 | <lambdabot> | Just 3 |
| 11:05:18 | <lortabac> | > sum <$> sequenceA [Just 1, Just 2, Nothing] |
| 11:05:19 | <lambdabot> | Nothing |
| 11:05:35 | <lortabac> | enoq: is this what you are looking for? ↑ |
| 11:05:38 | <enoq> | so pipe sum through applicative basically? |
| 11:05:45 | <enoq> | does that work for empty lists as well? |
| 11:06:11 | <lortabac> | > sum [] |
| 11:06:11 | <enoq> | > sum <$> sequenceA [] |
| 11:06:13 | <lambdabot> | 0 |
| 11:06:14 | <lambdabot> | error: |
| 11:06:14 | <lambdabot> | • Ambiguous type variable ‘f0’ arising from a use of ‘show_M275246096707... |
| 11:06:14 | <lambdabot> | prevents the constraint ‘(Show (f0 Integer))’ from being solved. |
| 11:06:27 | <enoq> | I want Nothing if the list is empty |
| 11:06:51 | <lortabac> | then you need to add an explicit check |
| 11:06:58 | <enoq> | ok, nvm, I want 0 |
| 11:07:00 | <enoq> | thanks |
| 11:07:39 | <enoq> | I really hate Haskell naming |
| 11:07:52 | <enoq> | sequenceA is a terrible name |
| 11:08:00 | <moonsheep> | > foldr (liftM2 (+)) Nothing [] |
| 11:08:03 | <lambdabot> | Nothing |
| 11:08:08 | <moonsheep> | > foldr (liftM2 (+)) Nothing [Just 1, Just 2, Just 3] |
| 11:08:10 | <lambdabot> | Nothing |
| 11:08:16 | <moonsheep> | oh wait shit |
| 11:08:26 | <moonsheep> | well if you want zero you can just foldr1 |
| 11:08:27 | <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' ? |
| 11:08:56 | <enoq> | ski: Nothing if list is empty or if one Nothing occurs in the list |
| 11:09:21 | <enoq> | I suppose sequenceA is something like a stream right? |
| 11:09:28 | <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 |
| 11:09:34 | <ski> | ' |
| 11:10:31 | <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') |
| 11:10:53 | <ski> | sequenceA [Just a,Just b,...Just y,Just z] = Just [a,b,...,y,z] |
| 11:10:53 | <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? |
| 11:11:16 | <enoq> | moonsheep: right, will go that route |
| 11:11:18 | <ski> | sequenceA [Just a,...,Just m,Nothing,Just o,...,Just z] = Nothing |
| 11:11:56 | × | moonsheep quits (~user@user/moonsheep) (Quit: ERC 5.4 (IRC client for GNU Emacs 28.2)) |
| 11:12:04 | <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 |
| 11:12:31 | <ski> | i'd suggest using `null' to check if the list is empty, and if it isn't, then use `sequenceA'/`sequence' |
| 11:12:48 | <ski> | (well, `null', or pattern-matching, if it happens to be handy) |
| 11:13:35 | <ski> | > case [Just 0,Just 1,Just 2,Just 3,Just 4] of [] -> Nothing; ms -> sequenceA ms |
| 11:13:37 | <lambdabot> | Just [0,1,2,3,4] |
| 11:13:44 | <ski> | > case [Just 0,Just 1,Nothing,Just 3,Just 4] of [] -> Nothing; ms -> sequenceA ms |
| 11:13:46 | <lambdabot> | Nothing |
| 11:13:49 | <ski> | > case [] of [] -> Nothing; ms -> sequenceA ms |
| 11:13:51 | <lambdabot> | Nothing |
| 11:15:10 | <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) |
| 11:16:05 | <ski> | <enoq> ok, nvm, I want 0 |
| 11:16:39 | <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 |
| 11:16:41 | × | zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection) |
| 11:17:39 | <ski> | `foldr (listM2 (+)) (return 0)' would also work, yea |
| 11:17:48 | → | zaquest joins (~notzaques@5.130.79.72) |
| 11:18:11 | <enoq> | yep, thanks, was just interested in the edge case |
| 11:18:15 | <ski> | enoq : .. not quite sure what you mean by "I suppose sequenceA is something like a stream right?" |
| 11:18:31 | <enoq> | what does does it do? |
| 11:18:40 | <enoq> | create one applicative for all wrapped things? |
| 11:19:06 | <ski> | `foldr (liftA2 (+)) (pure 0) ms' does the same thing as `sum <$> sequenceA ms' |
| 11:19:28 | <ski> | except it doesn't construct an intermediate list |
| 11:19:45 | <enoq> | I suppose A2 wraps a binary function in an applicative? |
| 11:19:54 | <ski> | yes, you could say so |
| 11:20:13 | × | rembo10 quits (~rembo10@main.remulis.com) (Quit: ZNC 1.8.2 - https://znc.in) |
| 11:20:19 | <ski> | liftA2 :: (a -> b -> c) -> (Maybe a -> Maybe b -> Maybe c) -- in this case |
| 11:21:38 | <enoq> | thank you |
| 11:22:05 | <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) |
| 11:22:21 | → | rembo10 joins (~rembo10@main.remulis.com) |
| 11:26:19 | <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 |
| 11:26:37 | <ski> | (and perhaps `pure' would have been named `return') |
| 11:26:41 | <enoq> | at some point someone needs to redo haskell with proper naming |
| 11:27:03 | <enoq> | like get rid of all the M and A and the mumbo jumbo operators like <*> |
| 11:28:00 | <ski> | and ditto for `mapM',`mapM_',`forM',`forM_' (using `Monad') vs. `traverse',`traverse_',`for',`for_' (using `Applicative') |
| 11:28:32 | <ski> | well, `f <$> foo <*> bar <*> baz' is a quite handy pattern |
| 11:28:50 | <ski> | if |
| 11:28:57 | <ski> | f :: A -> B -> C -> D |
| 11:29:04 | <enoq> | f `into` foo `pipe` ... |
| 11:29:06 | <ski> | foo :: I A |
| 11:29:08 | <enoq> | something like that |
| 11:29:09 | <ski> | bar :: I B |
| 11:29:15 | <ski> | baz :: I C |
| 11:29:16 | <ski> | then |
| 11:29:26 | <ski> | f <$> foo <*> bar <*> baz :: I D |
| 11:29:29 | <byorgey> | . o O ( that cleaned-up version of Haskell could just support idiom brackets ) |
| 11:29:35 | <ski> | where `Applicative I' |
| 11:29:46 | <ski> | byorgey : well .. i have a better option in mind |
| 11:30:09 | <ski> | (idiom brackets don't go far enough) |
| 11:30:37 | <byorgey> | oh? do tell! |
| 11:30:39 | <ski> | enoq : i guess .. but i don't really see that as better than the current `<$>',`<*>' |
| 11:30:59 | <enoq> | it does the same yeah, but it's short and readable |
| 11:31:03 | <ski> | oh, well. i've talked about it in here, now and then |
| 11:31:18 | ski | doesn't find the `into' and `pipe' suggestive |
| 11:31:28 | <enoq> | :p |
| 11:31:51 | → | nate3 joins (~nate@98.45.169.16) |
| 11:32:05 | <ski> | byorgey : basically, extend Haskell syntax with a notion of "local lexical/static side-effects". using syntactic constructions reminiscent of quasi-quotation |
| 11:33:06 | <enoq> | there are a couple of other things as well that probably have been talked to death already |
| 11:33:18 | <enoq> | like use Mapable instead of Functor or Flatmappable instead of Monad |
| 11:34:21 | <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 |
| 11:34:37 | <ski> | anyway, consider an example |
| 11:34:46 | <ski> | data Person = MkPerson Name Age |
| 11:34:49 | <ski> | and parsers |
| 11:34:55 | <ski> | parseName :: Parser Name |
| 11:35:01 | <ski> | parseAge :: Parser Age |
| 11:35:15 | <ski> | now, we can construct a parser for `Person', like |
| 11:35:24 | <ski> | parsePerson :: Parser Person |
| 11:35:34 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 258 seconds) |
| 11:35:48 | <ski> | parsePerson = [> MkPerson [<parseName>] [<parseAge>] <] |
| 11:36:05 | <ski> | the intermediate expressions here have the following types |
| 11:36:23 | <ski> | [<parseName>] :: Name -- with `Parser'-side-effects |
| 11:36:41 | <ski> | [<parseAge >] :: Age -- with `Parser'-side-effects |
| 11:37:01 | <ski> | MkPerson [<parseName>] [<parseAge>] :: Person -- with `Parser'-side-effects |
| 11:37:06 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
| 11:37:36 | <ski> | and then `[> ... <]' lexically encapsulates the side-effects, reifying them into an ordinary effect represented by having the type `Parser Person' |
| 11:37:40 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 11:38:04 | <ski> | now, compare with Idiom brackets. let's write `[| ... |]' for those, for the purpose of this discussion |
| 11:38:09 | <ski> | we have a translation rule |
| 11:39:00 | <ski> | [| <expr0> <expr> ... |] = <expr0> <$> <expr> <*> ... |
| 11:39:04 | <ski> | or, in the nullary case |
| 11:39:17 | <ski> | [| <expr0> |] = pure <expr0> |
| 11:41:17 | <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 |
| 11:41:23 | <ski> | equal to the number of applications on that path |
| 11:41:45 | <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 |
| 11:42:01 | <ski> | this is because my translation rules look like |
| 11:42:34 | <ski> | [> [< <expr> >] <] = <expr> |
| 11:43:48 | <ski> | [> <expr0> <Expr> <] = <expr0> <$> [> <Expr> <] -- where `<Expr>' is an expression that contains at least one (undischarged by `[>...<]') `[<...>]' (while `<expr>' contains none) |
| 11:44:19 | <ski> | [> <Expr0> <expr> <] = ($ <expr>) <$> [> <Expr> <] |
| 11:44:48 | <ski> | [> <Expr0> <Expr> <] = [> <Expr0> <] <*> [> <Expr> <] |
| 11:45:03 | <ski> | [> <expr> <] = pure <expr> |
| 11:46:14 | <ski> | so, these rules propagate the "reify" brackets `[> ... <]' down each path in the tree where there is at least one "reflect" bracket `[< ... >]' somewhere inside |
| 11:46:34 | <ski> | (while also making sure to only rely on `Functor', rather than `Applicative', when possible) |
| 11:46:53 | <ski> | furthermore, this can easily also be extended to cover `Monad' |
| 11:47:45 | <ski> | [> let <pat> = <Expr> in <Expr'> <] = do <pat> <- [> <Expr> <]; [> <Expr'> <] |
| 11:48:29 | × | Joao003 quits (~Joao003@187.85.87.1) (Quit: Client closed) |
| 11:48:46 | → | Joao003 joins (~Joao003@187.85.87.1) |
| 11:49:07 | <ski> | [> if <Expr> then <Expr'0> else <Expr'1> <] = [> <Expr> <] >>= \<id> -> if <id> then [> <Expr'0> <] else [> <Expr'1> <] -- where `<id>' is fresh |
| 11:50:02 | <ski> | [> case <Expr> of <pat> -> <Expr'>; ... <] = [> <Expr> <] >>= \case <pat> -> [> <Expr'> <]; ... |
| 11:51:25 | × | Joao003 quits (~Joao003@187.85.87.1) (Client Quit) |
| 11:52:46 | <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 |
| 11:54:06 | <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 |
| 11:54:17 | <ski> | byorgey : ^ that's basically it |
| 11:54:20 | × | stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 11:54:41 | <ski> | (oh, and i have type system rules as well, not just translation rules) |
| 11:55:38 | → | stiell_ joins (~stiell@gateway/tor-sasl/stiell) |
| 11:56:05 | <ski> | (one could also possibly allow some extra syntactical nicities, like saying `[<parsePerson>] = MkPerson [<parseName>] [<parseAge>]', instead of what i said above) |
| 11:57:17 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 11:57:17 | → | notzmv joins (~zmv@user/notzmv) |
| 11:58:31 | <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 |
| 11:58:37 | <ski> | Haskell |
| 12:00:14 | <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 |
| 12:00:17 | → | titibandit joins (~titibandi@xdsl-212-8-150-57.nc.de) |
| 12:03:15 | → | __monty__ joins (~toonn@user/toonn) |
| 12:06:31 | <byorgey> | ski: very nice, I like it |
| 12:07:43 | <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 |
| 12:08:03 | → | darkstardevx joins (~darkstard@192.183.207.94) |
| 12:08:32 | <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) |
| 12:09:44 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 12:10:56 | → | waldo joins (~waldo@user/waldo) |
| 12:11:24 | <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 |
| 12:11:38 | <dminuoso> | The solution was so simple in the end. |
| 12:16:00 | → | nschoe joins (~quassel@2a01:e0a:8e:a190:23a7:87b9:3709:55dd) |
| 12:19:03 | <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 |
| 12:19:09 | <ski> | that knowledge *does* correctly apply here |
| 12:19:45 | <enoq> | it would at least get rid of the Burritos |
| 12:20:33 | <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 |
| 12:21:01 | <enoq> | yes, that's how it should be done :P |
| 12:21:49 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 244 seconds) |
| 12:22:14 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 12:22:38 | → | img joins (~img@user/img) |
| 12:24:09 | × | img quits (~img@user/img) (Client Quit) |
| 12:24:10 | <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) |
| 12:26:33 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 12:27:11 | → | img joins (~img@user/img) |
| 12:27:39 | <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/>) |
| 12:27:50 | <ski> | then there are some more in-depth ones, like |
| 12:27:59 | <ski> | @where AAM |
| 12:27:59 | <lambdabot> | http://www.haskell.org/haskellwiki/All_About_Monads |
| 12:28:03 | <ski> | @where MTSS |
| 12:28:03 | <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> |
| 12:28:06 | <ski> | and also |
| 12:28:12 | <ski> | @where Typeclassopedia |
| 12:28:12 | <lambdabot> | http://www.haskell.org/haskellwiki/Typeclassopedia |
| 12:28:50 | <ski> | (and i'm probably forgetting some that i've seen and liked) |
| 12:29:03 | <jean-paul[m]> | MTSS link is dead |
| 12:30:48 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 265 seconds) |
| 12:32:36 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 12:33:31 | <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 |
| 12:35:24 | <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/materialien/monad-transformers-step-by-step.pdf> works |
| 12:35:27 | → | kenran joins (~user@user/kenran) |
| 12:35:48 | <jean-paul[m]> | np. thanks for that great pile of reading. :) |
| 12:36:14 | <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/materialien/monad-transformers-step-by-step.pdf> |
| 12:36:14 | <lambdabot> | Done. |
| 12:38:01 | <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 |
| 12:38:17 | <ski> | Typeclassopedia has exercises for `Functor' and `Applicative' as well |
| 12:38:32 | <dr_merijn> | Did someone recommend wadler's paper yet?:p |
| 12:38:45 | <ski> | er, i don't think anyone did, today |
| 12:38:58 | <ski> | (i linked to his monad page, the other day, though) |
| 12:39:16 | <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 |
| 12:39:22 | <ski> | (start from the oldest one) |
| 12:39:33 | <dr_merijn> | 50 links on blogposts and tutorials and you didn't even start with his? :p |
| 12:39:54 | <ski> | well .. some people feel intimidated by diving into research papers |
| 12:39:59 | <dr_merijn> | I still think Wadler's monad paper is one of the best/easiest intros |
| 12:40:17 | <dr_merijn> | ski: Sure, but that's just a teachable moment about how some are fuzzy and welcoming :p |
| 12:40:37 | <ski> | (even though Wadler's ones are usually quite readable, also to people who're not really into type systems stuff) |
| 12:40:42 | <ski> | yes |
| 12:42:07 | <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 |
| 12:42:33 | ski | agrees about the Wadler papers being great |
| 12:43:19 | → | rockymarine joins (~rocky@user/rockymarine) |
| 12:44:53 | → | Guest73 joins (~Guest73@p200300ef9718357f545f1ba775403e5c.dip0.t-ipconnect.de) |
| 12:45:46 | <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 .. |
| 12:47:23 | → | coot joins (~coot@213.134.165.79) |
| 12:49:10 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 258 seconds) |
| 12:50:01 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 260 seconds) |
| 12:50:13 | <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? |
| 12:56:01 | <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') |
| 12:57:17 | <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) |
| 12:57:43 | <ski> | (you might want someone with more TH experience, though) |
| 12:58:23 | <jco> | It's not a requirement that the type of `deriveDummy` isn't changed... |
| 12:59:01 | <ski> | hm, you'd also need to bundle the `TextShow a' constraint, somewhere |
| 13:00:14 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Remote host closed the connection) |
| 13:00:49 | <ski> | i don't know if it's possible to compare the `TypeRep' inside a `Dynamic' with what `conT' returns |
| 13:00:58 | <ski> | @hoogle conT |
| 13:00:58 | <lambdabot> | Control.Monad.Trans.Cont cont :: ((a -> r) -> r) -> Cont r a |
| 13:00:58 | <lambdabot> | Control.Monad.Cont cont :: () => a -> r -> r -> Cont r a |
| 13:00:58 | <lambdabot> | Language.Haskell.TH.Lib conT :: Name -> TypeQ |
| 13:01:03 | <ski> | @hoogle Dynamic -> TypeRep |
| 13:01:05 | <lambdabot> | Data.Rank1Dynamic dynTypeRep :: Dynamic -> TypeRep |
| 13:01:05 | <lambdabot> | Data.Typeable typeOf :: forall a . Typeable a => a -> TypeRep |
| 13:01:05 | <lambdabot> | Protolude typeOf :: Typeable a => a -> TypeRep |
| 13:01:07 | → | zebrag joins (~chris@user/zebrag) |
| 13:01:17 | <ski> | ok, the other one's a `TypeQ' |
| 13:01:29 | <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... |
| 13:01:54 | <ski> | "have one parameter be of the type specified by another" -- basically sounds like dependent types, to me |
| 13:02:18 | <ski> | unless you can do phantom tricks, like `ExprT' |
| 13:02:36 | → | talismanick joins (~talismani@2601:200:c100:c9e0::24ac) |
| 13:02:50 | <ski> | @hoogle TExp |
| 13:02:50 | <lambdabot> | Language.Haskell.TH data TExp (a :: TYPE (r :: RuntimeRep)) |
| 13:02:51 | <lambdabot> | Language.Haskell.TH.Syntax newtype TExp (a :: TYPE (r :: RuntimeRep)) |
| 13:02:51 | <lambdabot> | Language.Haskell.TH.Syntax TExp :: Exp -> TExp (a :: TYPE (r :: RuntimeRep)) |
| 13:03:01 | <ski> | ah, it was called `TExp' (i forgot) |
| 13:03:25 | <jco> | Can I use that here you think? |
| 13:03:45 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 252 seconds) |
| 13:04:08 | <ski> | you'd need a corresponding version for `Name', i guess `TName' |
| 13:04:09 | × | luffy quits (~chenqisu1@183.217.201.220) (Ping timeout: 265 seconds) |
| 13:04:28 | <ski> | deriveDummy :: TextShow a => TName a -> a -> Q [Dec] |
| 13:04:37 | <ski> | but i dunno if there is anything like that |
| 13:04:51 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 13:05:18 | <ski> | (also, i'm thinking `a' should be a liftable type .. but perhaps `TextShow' serves a similar purpose, in your example) |
| 13:07:45 | <ski> | (like <https://hackage.haskell.org/package/th-lift-0.8.2/docs/Language-Haskell-TH-Lift.html>) |
| 13:10:13 | <dr_merijn> | jco: What are you trying to figure out? |
| 13:10:19 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 13:14:46 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds) |
| 13:19:12 | × | Guest73 quits (~Guest73@p200300ef9718357f545f1ba775403e5c.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 13:24:25 | <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... |
| 13:25:52 | <jco> | dr_merijn: To avoid having duplicated (long) typeclass instance definitions, where everything, except some small parts (the values) will be repeated. |
| 13:26:23 | <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... |
| 13:27:02 | <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... |
| 13:29:02 | <dr_merijn> | jco: What's breaking in that example? |
| 13:29:14 | × | poscat0x04 quits (~poscat@2408:8206:4823:2a7:d78b:34b7:cd4f:29cd) (Quit: Bye) |
| 13:31:34 | × | inversed quits (~inversed@90.209.137.56) (Ping timeout: 246 seconds) |
| 13:33:23 | → | zer0bitz joins (~zer0bitz@2001:2003:f748:2000:b409:b96f:ba06:b5f) |
| 13:33:30 | → | poscat joins (~poscat@2408:8206:4823:fc46:6bc1:f6c:f388:b18d) |
| 13:34:30 | → | inversed joins (~inversed@90.209.137.56) |
| 13:38:26 | × | poscat quits (~poscat@2408:8206:4823:fc46:6bc1:f6c:f388:b18d) (Quit: Bye) |
| 13:41:51 | → | poscat joins (~poscat@2408:8206:4823:fd6f:98ab:5c38:136c:5932) |
| 13:43:17 | × | ph88^ quits (~ph88@95.90.247.31) (Quit: Leaving) |
| 13:44:30 | × | frost quits (~frost@user/frost) (Ping timeout: 252 seconds) |
| 13:44:52 | × | causal quits (~user@50.35.83.177) (Quit: WeeChat 3.6) |
| 13:45:15 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 13:47:50 | <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 |
| 13:48:09 | → | gmg joins (~user@user/gehmehgeh) |
| 13:50:49 | → | rockymarine joins (~rocky@user/rockymarine) |
| 13:50:57 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 13:52:29 | <maralorn> | Huh, adding `-prof` fixes it, despite cabal printing that one should not do this. |
| 13:52:51 | <geekosaur> | that one you might ask in #hackage |
| 13:53:08 | <geekosaur> | include cabal-install version and probably Cabal library version |
| 13:53:49 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 13:55:28 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 13:55:42 | × | waleee quits (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Quit: WeeChat 3.6) |
| 13:57:00 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Remote host closed the connection) |
| 13:58:04 | <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`. |
| 13:58:27 | <jco> | dr_merijn: (Which is what I want to figure out how to specify.) |
| 14:02:11 | → | slack1256 joins (~slack1256@191.125.227.202) |
| 14:07:19 | → | moonsheep joins (~user@user/moonsheep) |
| 14:07:59 | <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? |
| 14:09:39 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 14:10:15 | <moonsheep> | the closest I've found is `peekBytes' from the ptr package |
| 14:12:58 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 14:18:22 | <dr_merijn> | moonsheep: Where are you getting the Ptr from? |
| 14:18:28 | <dr_merijn> | Your own code? or externally? |
| 14:20:16 | <dr_merijn> | moonsheep: Because depending on the answer, turning it into a ByteString is gonna be super cheap :p |
| 14:21:32 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.6) |
| 14:22:01 | <moonsheep> | dr_merijn: `withByteArray' from `ByteArrayAccess ba' in the memory package |
| 14:23:16 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 14:24:01 | <dr_merijn> | Ugh, I never liked that class. Ok, that probably rules out any cheap conversions |
| 14:24:18 | <dr_merijn> | moonsheep: Basically, the only API cereal supports is most likely ByteString |
| 14:24:25 | × | hrberg quits (~quassel@171.79-160-161.customer.lyse.net) (Ping timeout: 246 seconds) |
| 14:25:16 | <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 |
| 14:25:37 | → | Sose joins (~sose@mobile-access-567367-206.dhcp.inet.fi) |
| 14:25:48 | <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 |
| 14:28:23 | <sm> | dminuoso: hurrah! \o/ |
| 14:28:24 | <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 |
| 14:29:09 | <dr_merijn> | sm: Because the set of things that have "simple solutions" is considerably larger in Haskell :p |
| 14:29:39 | <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 ;) |
| 14:30:30 | <sm> | fair but we can lean on that only so many years before it rings hollow |
| 14:30:45 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 14:31:25 | <dr_merijn> | I dunno, most other languages don't really seem to have "nice maintained cookbooks" either, so seems unfair to single out specifically |
| 14:31:31 | <sm> | parsing is super common, megaparsec is our most popular lib for it, it has among the best docs of haskell libs, yet,, |
| 14:31:34 | <dr_merijn> | methinks it's just programmers who are the problem ;) |
| 14:31:48 | sm | goes to see if it's documented |
| 14:31:57 | <dr_merijn> | I think megaparsec docs were...considerably better when it was first forked |
| 14:32:42 | <dr_merijn> | The latest versions docs are considerably less intuitively navigatable and I have to rely on the tutorial/book chapter frequently |
| 14:33:08 | <dr_merijn> | the re-exports they use now hide a lot of stuff too |
| 14:33:25 | <dr_merijn> | but people like reworking it more than they like updating the docs :p |
| 14:34:42 | <sm> | sorry to hear that. Do you mean the haddocks ? |
| 14:34:59 | <sm> | dminuoso, is https://markkarpov.com/tutorial/megaparsec.html#catching-parse-errors-in-a-running-parser relevant to this? |
| 14:35:36 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 260 seconds) |
| 14:35:37 | × | jonathanx quits (~jonathan@h-98-128-168-222.NA.cust.bahnhof.se) (Remote host closed the connection) |
| 14:37:05 | <sm> | it's not the simple cookbook I imagined, but it's pretty good |
| 14:37:26 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 265 seconds) |
| 14:38:04 | <dr_merijn> | sm: The haddocks yes |
| 14:38:14 | × | Sose quits (~sose@mobile-access-567367-206.dhcp.inet.fi) (Quit: Leaving) |
| 14:38:49 | → | akegalj joins (~akegalj@213-202-90-31.dsl.iskon.hr) |
| 14:39:01 | <sm> | at least php style comments on haddocks would help |
| 14:40:46 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 14:41:54 | → | kuribas joins (~user@silversquare.silversquare.eu) |
| 14:42:32 | → | Guest73 joins (~Guest73@p200300ef9718351a900cd859c72eccfd.dip0.t-ipconnect.de) |
| 14:42:50 | → | yvan-sraka joins (~yvan-srak@2a02:2788:224:71c:9500:1293:30f0:c5fc) |
| 14:44:03 | <monochrom> | Unpopular opinion: I despise cookbook cultures. |
| 14:45:46 | <dr_merijn> | monochrom: Same |
| 14:46:03 | <dr_merijn> | And back when I touched PHP I found a lot of the comments...very bad quality |
| 14:47:31 | <monochrom> | In positive news, I have learned the löb function! I am also learning Löb's theorem, actually modal logics too. |
| 14:51:06 | × | yvan-sraka quits (~yvan-srak@2a02:2788:224:71c:9500:1293:30f0:c5fc) (Remote host closed the connection) |
| 14:51:16 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 268 seconds) |
| 14:51:42 | × | waldo quits (~waldo@user/waldo) (Quit: quit) |
| 14:52:23 | <moonsheep> | dr_merijn: sorry for the late reply. what should I do then? how can I copy the ptr into a brand new bytestring? |
| 14:52:55 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds) |
| 14:53:29 | <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. |
| 14:54:30 | <dolio> | That's cute. |
| 14:59:05 | → | rockymarine joins (~rocky@user/rockymarine) |
| 14:59:26 | × | jco quits (~jco@90-228-194-139-no542.tbcn.telia.com) (Remote host closed the connection) |
| 15:04:26 | <ski> | "Logic of Provability" by George Boolos might be interesting, re Löb |
| 15:09:12 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 15:09:28 | × | jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 15:10:23 | <dr_merijn> | moonsheep: You probably want: https://hackage.haskell.org/package/bytestring-0.11.3.1/docs/Data-ByteString.html#v:packCStringLen |
| 15:10:43 | <dr_merijn> | moonsheep: (note that CStringLen is basically just a tuple of a pointer and a length) |
| 15:12:00 | → | jpds1 joins (~jpds@gateway/tor-sasl/jpds) |
| 15:12:17 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 15:13:25 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 250 seconds) |
| 15:14:30 | <moonsheep> | dr_merijn: ah tysm! |
| 15:20:13 | <Franciman> | congrats dr_merijn for the dr |
| 15:24:36 | × | dr_merijn quits (~dr_merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
| 15:26:49 | × | nschoe quits (~quassel@2a01:e0a:8e:a190:23a7:87b9:3709:55dd) (Ping timeout: 268 seconds) |
| 15:27:47 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 15:33:23 | → | nate3 joins (~nate@98.45.169.16) |
| 15:34:41 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 15:37:11 | → | mikoto-chan joins (~mikoto-ch@2001:999:680:550c:3900:bcbe:e04:51b9) |
| 15:38:19 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 265 seconds) |
| 15:41:13 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 15:43:02 | × | kuribas quits (~user@silversquare.silversquare.eu) (Read error: Connection reset by peer) |
| 15:43:15 | → | kuribas joins (~user@silversquare.silversquare.eu) |
| 15:44:38 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:445e:b42c:e761:f5db) (Quit: WeeChat 2.8) |
| 15:46:00 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds) |
| 15:46:45 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 15:47:53 | → | slac36995 joins (~slack1256@186.11.98.128) |
| 15:49:55 | × | slack1256 quits (~slack1256@191.125.227.202) (Ping timeout: 248 seconds) |
| 15:50:58 | → | dr_merijn joins (~dr_merijn@86-86-29-250.fixed.kpn.net) |
| 15:51:07 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 250 seconds) |
| 15:51:59 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 15:53:00 | → | gmg joins (~user@user/gehmehgeh) |
| 15:53:39 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 15:54:23 | → | gmg joins (~user@user/gehmehgeh) |
| 15:54:40 | × | mikoto-chan quits (~mikoto-ch@2001:999:680:550c:3900:bcbe:e04:51b9) (Ping timeout: 244 seconds) |
| 15:56:01 | → | acidjnk_new joins (~acidjnk@p200300d6e7137a441827c7a2ee98ef4a.dip0.t-ipconnect.de) |
| 15:59:21 | × | acidjnk quits (~acidjnk@p200300d6e7137a161827c7a2ee98ef4a.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 15:59:46 | → | Tuplanolla joins (~Tuplanoll@91-159-69-34.elisa-laajakaista.fi) |
| 16:11:22 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 16:14:05 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 250 seconds) |
| 16:14:52 | → | rockymarine joins (~rocky@user/rockymarine) |
| 16:18:47 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 16:20:41 | → | jero98772 joins (~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c) |
| 16:28:39 | → | fmgornick joins (~fmgornick@96.72.43.173) |
| 16:28:49 | <fmgornick> | ?src head |
| 16:28:50 | <lambdabot> | head (x:_) = x |
| 16:28:50 | <lambdabot> | head [] = error "Prelude.head: empty list" |
| 16:28:58 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 16:29:08 | × | fmgornick quits (~fmgornick@96.72.43.173) (Client Quit) |
| 16:30:04 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 246 seconds) |
| 16:30:22 | <EvanR> | head, one of the sharper tools in the box |
| 16:31:14 | → | econo joins (uid147250@user/econo) |
| 16:33:18 | × | moonsheep quits (~user@user/moonsheep) (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)) |
| 16:34:04 | → | rockymarine joins (~rocky@user/rockymarine) |
| 16:35:13 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:36:24 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 16:38:15 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 252 seconds) |
| 16:38:42 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 16:39:35 | → | Everything joins (~Everythin@37.115.210.35) |
| 16:39:55 | → | gmg joins (~user@user/gehmehgeh) |
| 16:40:12 | × | kuribas quits (~user@silversquare.silversquare.eu) (Remote host closed the connection) |
| 16:40:18 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 16:42:47 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:45:34 | <EvanR> | :q |
| 16:46:48 | → | yvan-sraka joins (~yvan-srak@2a02:2788:224:71c:b245:572d:f388:b75c) |
| 16:46:56 | → | waleee joins (~waleee@192.165.44.49) |
| 16:47:34 | → | slack1256 joins (~slack1256@191.125.227.202) |
| 16:47:39 | → | nschoe joins (~quassel@2a01:e0a:8e:a190:8ad:294d:95c5:8589) |
| 16:49:51 | × | slac36995 quits (~slack1256@186.11.98.128) (Ping timeout: 265 seconds) |
| 16:50:38 | × | nschoe quits (~quassel@2a01:e0a:8e:a190:8ad:294d:95c5:8589) (Client Quit) |
| 16:54:03 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Read error: Connection timed out) |
| 16:58:36 | → | waldo joins (~waldo@user/waldo) |
| 17:00:15 | × | akegalj quits (~akegalj@213-202-90-31.dsl.iskon.hr) (Quit: leaving) |
| 17:02:12 | → | fmgornick joins (~fmgornick@2607:ea00:107:3c07:1847:3a0a:5902:4b8e) |
| 17:02:20 | <fmgornick> | ?src scanl |
| 17:02:21 | <lambdabot> | scanl f q ls = q : case ls of |
| 17:02:21 | <lambdabot> | [] -> [] |
| 17:02:21 | <lambdabot> | x:xs -> scanl f (f q x) xs |
| 17:02:46 | × | fmgornick quits (~fmgornick@2607:ea00:107:3c07:1847:3a0a:5902:4b8e) (Client Quit) |
| 17:03:52 | → | wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com) |
| 17:03:52 | × | wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host) |
| 17:03:52 | → | wroathe joins (~wroathe@user/wroathe) |
| 17:09:45 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 17:18:08 | kawzeg_ | is now known as kawzeg |
| 17:18:47 | → | emmanuelux joins (~emmanuelu@2a01cb0000f3930028bb2a9bfdb59a78.ipv6.abo.wanadoo.fr) |
| 17:19:27 | → | rockymarine joins (~rocky@user/rockymarine) |
| 17:26:41 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Remote host closed the connection) |
| 17:30:47 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 17:30:51 | → | king_gs joins (~Thunderbi@2806:103e:29:5a6:d0be:f9c4:80c9:e8c5) |
| 17:31:12 | × | king_gs quits (~Thunderbi@2806:103e:29:5a6:d0be:f9c4:80c9:e8c5) (Client Quit) |
| 17:31:20 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Read error: Connection timed out) |
| 17:32:12 | marinelli[m] | is now known as marinelli |
| 17:32:48 | marinelli | is now known as marinelli[m] |
| 17:32:58 | × | coot quits (~coot@213.134.165.79) (Quit: coot) |
| 17:33:15 | × | ellensol quits (~ellen@178-78-210-152.customers.ownit.se) (Ping timeout: 268 seconds) |
| 17:35:11 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 17:35:45 | × | marinelli[m] quits (~marinelli@2001:470:69fc:105::2d8) (Quit: issued !quit command) |
| 17:40:26 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 17:42:25 | × | Major_Biscuit quits (~MajorBisc@c-001-023-044.client.tudelft.eduvpn.nl) (Ping timeout: 252 seconds) |
| 17:42:39 | × | talismanick quits (~talismani@2601:200:c100:c9e0::24ac) (Ping timeout: 244 seconds) |
| 17:44:10 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 17:46:03 | × | zeenk quits (~zeenk@2a02:2f04:a311:2d00:6865:d863:4c93:799f) (Quit: Konversation terminated!) |
| 17:46:45 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 17:47:46 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 246 seconds) |
| 17:48:26 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 17:50:59 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 248 seconds) |
| 17:51:12 | → | gmg joins (~user@user/gehmehgeh) |
| 17:53:14 | → | ardell joins (~ardell@user/ardell) |
| 17:56:53 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 18:01:35 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 18:02:17 | × | waleee quits (~waleee@192.165.44.49) (Ping timeout: 244 seconds) |
| 18:05:16 | × | fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 246 seconds) |
| 18:06:38 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 268 seconds) |
| 18:09:26 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 18:10:27 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 18:13:15 | × | enoq quits (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) (Quit: enoq) |
| 18:21:58 | → | rockymarine joins (~rocky@user/rockymarine) |
| 18:26:37 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 260 seconds) |
| 18:26:42 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 18:27:12 | → | mmhat joins (~mmh@p200300f1c7062304ee086bfffe095315.dip0.t-ipconnect.de) |
| 18:28:02 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 18:31:14 | → | ellensol joins (~ellen@ua-84-216-129-63.bbcust.telenor.se) |
| 18:31:18 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Ping timeout: 268 seconds) |
| 18:33:25 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 18:36:37 | → | waleee joins (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) |
| 18:37:56 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 244 seconds) |
| 18:41:15 | → | rockymarine joins (~rocky@user/rockymarine) |
| 18:51:15 | × | yvan-sraka quits (~yvan-srak@2a02:2788:224:71c:b245:572d:f388:b75c) (Remote host closed the connection) |
| 18:52:57 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt juan@acm.org) |
| 18:53:26 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 244 seconds) |
| 18:56:18 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 18:56:40 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 18:56:59 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds) |
| 18:57:04 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 246 seconds) |
| 18:59:23 | Lord_of_Life_ | is now known as Lord_of_Life |
| 19:01:08 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 19:07:05 | → | rockymarine joins (~rocky@user/rockymarine) |
| 19:11:16 | → | hrberg joins (~quassel@171.79-160-161.customer.lyse.net) |
| 19:11:31 | → | pavonia joins (~user@user/siracusa) |
| 19:12:49 | × | zer0bitz quits (~zer0bitz@2001:2003:f748:2000:b409:b96f:ba06:b5f) (Ping timeout: 246 seconds) |
| 19:15:12 | → | talismanick joins (~talismani@96-67-197-217-static.hfc.comcastbusiness.net) |
| 19:21:54 | → | LukeHoersten joins (~LukeHoers@user/lukehoersten) |
| 19:23:51 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 19:24:32 | × | ubert quits (~Thunderbi@77.119.161.212.wireless.dyn.drei.com) (Ping timeout: 265 seconds) |
| 19:25:07 | × | LukeHoersten quits (~LukeHoers@user/lukehoersten) (Client Quit) |
| 19:30:23 | × | ellensol quits (~ellen@ua-84-216-129-63.bbcust.telenor.se) (Read error: Connection reset by peer) |
| 19:31:20 | × | Kaiepi quits (~Kaiepi@142.68.249.28) (Remote host closed the connection) |
| 19:31:31 | <dminuoso> | sm: Not quite. |
| 19:31:44 | → | Kaiepi joins (~Kaiepi@142.68.249.28) |
| 19:32:36 | <dminuoso> | sm: What was quite cool about nested parsers, is that I could simply run: r <- lift $ runParserT principleFile' path txt |
| 19:32:58 | <dminuoso> | And the beauty is that I now have shared state and shared environment in the sub parser |
| 19:33:22 | <dminuoso> | https://gist.github.com/dminuoso/065e043d05cd601008729bc3c8198239 |
| 19:33:24 | <dminuoso> | It's so simple |
| 19:33:52 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 19:34:51 | → | nate3 joins (~nate@98.45.169.16) |
| 19:35:12 | × | Kaiepi quits (~Kaiepi@142.68.249.28) (Read error: Connection reset by peer) |
| 19:35:38 | → | Kaiepi joins (~Kaiepi@142.68.249.28) |
| 19:37:08 | × | slack1256 quits (~slack1256@191.125.227.202) (Read error: Connection reset by peer) |
| 19:37:19 | → | slack1256 joins (~slack1256@186.11.98.123) |
| 19:40:20 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 19:41:36 | → | ellensol joins (~ellen@ua-84-216-129-63.bbcust.telenor.se) |
| 19:42:24 | × | talismanick quits (~talismani@96-67-197-217-static.hfc.comcastbusiness.net) (Ping timeout: 265 seconds) |
| 19:52:10 | × | waldo quits (~waldo@user/waldo) (Quit: quit) |
| 19:53:24 | <sm> | dminuoso: lovely! |
| 19:54:56 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 19:55:33 | → | ft joins (~ft@p3e9bc57b.dip0.t-ipconnect.de) |
| 19:58:07 | → | mestre joins (~mestre@191.177.181.194) |
| 20:01:44 | → | gustik joins (~gustik@2a01:c844:2457:2220:475d:34f:d571:996f) |
| 20:01:51 | → | talismanick joins (~talismani@2601:200:c100:c9e0::24ac) |
| 20:15:07 | <EvanR> | > [quotRem a b | a <- [10, -10], b <- [3, -3]] |
| 20:15:10 | <lambdabot> | [(3,1),(-3,1),(-3,-1),(3,-1)] |
| 20:16:40 | <EvanR> | is negative rem negative always negative |
| 20:16:46 | <EvanR> | or zero |
| 20:20:20 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 20:20:32 | <ski> | > [[n `quotRem` d | d <- [-3,3]] | n <- [-10,10]] |
| 20:20:34 | <lambdabot> | [[(3,-1),(-3,-1)],[(-3,1),(3,1)]] |
| 20:21:17 | → | coot joins (~coot@213.134.165.79) |
| 20:24:54 | <EvanR> | i think yes because q*b is negative but can't exceed a in negativeness, so you sometimes need to subtract more |
| 20:29:23 | → | shapr joins (~user@68.54.166.125) |
| 20:30:04 | × | Midjak quits (~Midjak@82.66.147.146) (Read error: Connection reset by peer) |
| 20:30:35 | → | Midjak2 joins (~Midjak@82.66.147.146) |
| 20:31:45 | × | coot quits (~coot@213.134.165.79) (Quit: coot) |
| 20:34:43 | <EvanR> | > ((-9223372036854775808) :: Int) `quotRem` (-1) |
| 20:34:44 | <lambdabot> | (*Exception: arithmetic overflow |
| 20:34:49 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 20:35:23 | <EvanR> | myth busted |
| 20:36:16 | <EvanR> | > ((-9223372036854775808) :: Int) `rem` (-1) |
| 20:36:17 | <lambdabot> | 0 |
| 20:36:35 | <EvanR> | how in the |
| 20:38:45 | <EvanR> | is it not using cpu instruction IDIV |
| 20:42:13 | <geekosaur> | bah, play's down |
| 20:42:15 | <int-e> | EvanR: https://gitlab.haskell.org/ghc/ghc/-/blob/e0ded198e9ec1c8bb7253506569e7ae47818e791/libraries/base/GHC/Real.hs#L355-360 |
| 20:43:12 | <int-e> | EvanR: It really can't use idiv directly because that would crash the program. |
| 20:44:23 | <EvanR> | oh look at that shit |
| 20:44:35 | <EvanR> | > snd $ ((-9223372036854775808) :: Int) `quotRem` (-1) |
| 20:44:37 | <lambdabot> | 0 |
| 20:44:39 | <int-e> | yeah it's not pretty at all. |
| 20:44:46 | <EvanR> | > fst $ ((-9223372036854775808) :: Int) `quotRem` (-1) |
| 20:44:48 | <lambdabot> | *Exception: arithmetic overflow |
| 20:48:48 | <EvanR> | > (error "!") `rem` (-1) |
| 20:48:50 | <lambdabot> | *Exception: ! |
| 20:49:04 | <EvanR> | it's lazy sometimes |
| 20:50:05 | <ski> | > 5 `mod` 0 |
| 20:50:07 | <lambdabot> | *Exception: divide by zero |
| 20:50:08 | <ski> | > 5 `rem` 0 |
| 20:50:10 | <lambdabot> | *Exception: divide by zero |
| 20:50:11 | <ski> | alas ! |
| 20:50:26 | <ski> | (imho, those ought to give `5') |
| 20:50:35 | <ski> | EvanR : i was hoping my example would dispel your confusion |
| 20:50:36 | <EvanR> | now for the crescendo |
| 20:50:50 | <EvanR> | > error "!" `rem` 0 |
| 20:50:51 | <lambdabot> | *Exception: divide by zero |
| 20:51:10 | <EvanR> | what |
| 20:51:43 | <ski> | apparently it checks denominator first |
| 20:51:45 | <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 |
| 20:51:59 | <EvanR> | the code for rem has a !a in the pattern |
| 20:54:26 | <ski> | > gcd 0 0 -- fwiw, this was fixed, some time ago |
| 20:54:27 | <lambdabot> | 0 |
| 20:55:10 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 20:55:38 | <EvanR> | > let f !a b | b==0 = error "?" in f (error "!") 0 |
| 20:55:40 | <lambdabot> | *Exception: ! |
| 20:56:01 | <EvanR> | > let f !a b | b==0 = error "?" in f 3 0 |
| 20:56:03 | <lambdabot> | *Exception: ? |
| 20:56:17 | <EvanR> | > rem (error "!") 0 |
| 20:56:19 | <lambdabot> | *Exception: divide by zero |
| 20:56:25 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 20:56:36 | <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 |
| 20:57:03 | <ski> | s/way/was/ |
| 20:57:07 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 252 seconds) |
| 20:57:08 | <EvanR> | so the bottoms sort of get in a hat and then one is selected |
| 20:57:14 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 20:57:17 | <ski> | yea |
| 20:57:48 | <ski> | i think i had some example where the bottom happened after the function had returned |
| 20:57:57 | <EvanR> | still I'm surprised to see the supposed code for rem evaluate !a "late" ? |
| 20:58:10 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 20:58:17 | <ski> | if you want more guarantees on evaluation order, you probably want `pseq' |
| 20:59:31 | <geekosaur> | pretty sure I've seen discussion of this by the ghc devs |
| 20:59:58 | <sm> | is there something like takeUntil in a standard-ish library ? I want one more element than takeWhile |
| 21:00:00 | <geekosaur> | (also pretty sure gcc does the same thing when it's a choice between two UBs) |
| 21:01:16 | <ski> | EvanR : anyway, the paper on imprecise exceptions mentions this |
| 21:01:46 | <ski> | (the "an arbitrary one is selected") |
| 21:01:53 | <EvanR> | yeah I knew that |
| 21:02:02 | → | nate3 joins (~nate@98.45.169.16) |
| 21:03:31 | × | cyphase quits (~cyphase@user/cyphase) (Ping timeout: 248 seconds) |
| 21:05:19 | → | cyphase joins (~cyphase@user/cyphase) |
| 21:05:39 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 21:07:38 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 21:07:55 | Unhammerd | is now known as Unhammer |
| 21:08:37 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 21:09:36 | → | Sciencentistguy9 joins (~sciencent@hacksoc/ordinary-member) |
| 21:10:50 | → | rockymarine joins (~rocky@user/rockymarine) |
| 21:11:48 | × | Sciencentistguy quits (~sciencent@hacksoc/ordinary-member) (Ping timeout: 264 seconds) |
| 21:11:48 | Sciencentistguy9 | is now known as Sciencentistguy |
| 21:13:19 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 21:15:26 | × | Midjak2 quits (~Midjak@82.66.147.146) (Read error: Connection reset by peer) |
| 21:15:36 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 21:18:28 | × | ellensol quits (~ellen@ua-84-216-129-63.bbcust.telenor.se) (Ping timeout: 246 seconds) |
| 21:24:16 | → | TonyStone joins (~TonyStone@2603-7080-8607-c36a-cc48-2eb7-9785-f03a.res6.spectrum.com) |
| 21:28:36 | × | mmhat quits (~mmh@p200300f1c7062304ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
| 21:41:53 | → | mikoto-chan joins (~mikoto-ch@2001:999:250:8e97:e6cf:477a:ca0:6032) |
| 21:41:58 | → | mmhat joins (~mmh@p200300f1c70623c9ee086bfffe095315.dip0.t-ipconnect.de) |
| 21:43:25 | → | ellensol joins (~ellen@ua-84-216-129-63.bbcust.telenor.se) |
| 21:44:00 | × | michalz quits (~michalz@185.246.207.215) (Remote host closed the connection) |
| 21:45:09 | × | acidjnk_new quits (~acidjnk@p200300d6e7137a441827c7a2ee98ef4a.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 21:50:21 | × | mikoto-chan quits (~mikoto-ch@2001:999:250:8e97:e6cf:477a:ca0:6032) (Ping timeout: 250 seconds) |
| 21:50:37 | → | burnsidesLlama joins (~burnsides@client-8-86.eduroam.oxuni.org.uk) |
| 21:52:11 | → | mikoto-chan joins (~mikoto-ch@85-76-146-167-nat.elisa-mobile.fi) |
| 21:52:16 | ec_ | is now known as ec |
| 21:52:58 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 21:53:08 | × | titibandit quits (~titibandi@xdsl-212-8-150-57.nc.de) (Remote host closed the connection) |
| 21:55:07 | × | burnsidesLlama quits (~burnsides@client-8-86.eduroam.oxuni.org.uk) (Ping timeout: 250 seconds) |
| 22:03:03 | × | rockymarine quits (~rocky@user/rockymarine) (Ping timeout: 244 seconds) |
| 22:04:13 | × | nate3 quits (~nate@98.45.169.16) (Ping timeout: 252 seconds) |
| 22:04:37 | × | stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 258 seconds) |
| 22:05:39 | × | waleee quits (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Ping timeout: 244 seconds) |
| 22:06:20 | → | waleee joins (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) |
| 22:11:32 | × | ardell quits (~ardell@user/ardell) (Quit: Leaving) |
| 22:15:01 | → | stiell_ joins (~stiell@gateway/tor-sasl/stiell) |
| 22:15:22 | → | bontaq joins (~user@ool-45779fe5.dyn.optonline.net) |
| 22:15:25 | × | Everything quits (~Everythin@37.115.210.35) (Quit: leaving) |
| 22:19:29 | × | mastarija quits (~mastarija@2a05:4f46:e03:6000:328e:3c75:e042:cc19) (Quit: WeeChat 3.5) |
| 22:20:35 | → | rockymarine joins (~rocky@user/rockymarine) |
| 22:31:00 | × | jero98772 quits (~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c) (Ping timeout: 264 seconds) |
| 22:31:42 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 268 seconds) |
| 22:35:11 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 22:41:04 | × | Guest73 quits (~Guest73@p200300ef9718351a900cd859c72eccfd.dip0.t-ipconnect.de) (Quit: Client closed) |
| 22:42:17 | → | jero98772 joins (~jero98772@2800:484:1d80:d8ce:efcc:cbb3:7f2a:6dff) |
| 22:43:31 | × | chomwitt quits (~chomwitt@2a02:587:dc14:f500:278:be15:4a20:8304) (Ping timeout: 268 seconds) |
| 22:44:19 | × | slack1256 quits (~slack1256@186.11.98.123) (Ping timeout: 248 seconds) |
| 22:45:00 | × | Tuplanolla quits (~Tuplanoll@91-159-69-34.elisa-laajakaista.fi) (Quit: Leaving.) |
| 23:15:21 | × | ellensol quits (~ellen@ua-84-216-129-63.bbcust.telenor.se) (Ping timeout: 252 seconds) |
| 23:19:04 | → | ellensol joins (~ellen@ua-84-216-129-63.bbcust.telenor.se) |
| 23:22:31 | × | thyriaen quits (~thyriaen@2a02:8109:8340:686c:7383:e0e2:ad95:9fce) (Quit: Leaving) |
| 23:33:35 | → | slack1256 joins (~slack1256@186.11.98.123) |
| 23:36:01 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 246 seconds) |
| 23:44:19 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 244 seconds) |
| 23:45:57 | → | causal joins (~user@50.35.83.177) |
| 23:51:53 | → | jargon joins (~jargon@184.101.186.15) |
| 23:54:49 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::778c) |
| 23:55:11 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 23:58:09 | → | moonsheep joins (~user@user/moonsheep) |
| 23:58:30 | <moonsheep> | hey, if anyone cares, I've found a solution to my problems this morning: https://hackage.haskell.org/package/memory-0.18.0/docs/Data-ByteArray.html#v:convert |
| 23:58:33 | <moonsheep> | took a bit of digging |
| 23:58:35 | <moonsheep> | thanks everyone |
All times are in UTC on 2022-09-28.