Logs: liberachat/#haskell
| 2021-07-29 16:28:26 | × | hgolden quits (~hgolden2@cpe-172-114-84-61.socal.res.rr.com) (Quit: Konversation terminated!) |
| 2021-07-29 16:28:32 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds) |
| 2021-07-29 16:29:07 | <motle> | lechner: it ensures its parsed at all |
| 2021-07-29 16:29:26 | <lechner> | it is not without? |
| 2021-07-29 16:29:42 | <motle> | not if by lazyness its never called, thats what stricness is about |
| 2021-07-29 16:29:47 | <motle> | calls it there and then |
| 2021-07-29 16:29:53 | <motle> | instead of deffering it to call by use |
| 2021-07-29 16:30:44 | <lechner> | where does it go in an array please? [! Constituent] or ![ Constituent ] ? |
| 2021-07-29 16:30:44 | <kritzefitz> | motle, are you sure? Because if we're talking about parsing with aeson, it should parse everything strictly to be able to report failures. |
| 2021-07-29 16:30:50 | → | mattil joins (~mattilinn@87-92-17-82.bb.dnainternet.fi) |
| 2021-07-29 16:31:03 | <motle> | lechner: maybe its only used in pattern bindings? |
| 2021-07-29 16:31:21 | <motle> | im not sure no |
| 2021-07-29 16:31:30 | <superstar64> | i'm trying to write a traversal for a higher kinded typed. is this possible? https://gist.github.com/Superstar64/d04cce9dd60f931a18868a648ff5b22a |
| 2021-07-29 16:31:32 | → | hgolden joins (~hgolden2@cpe-172-114-84-61.socal.res.rr.com) |
| 2021-07-29 16:31:52 | <superstar64> | `g λ` doesn't work because e doesn't match with e' |
| 2021-07-29 16:31:57 | <kritzefitz> | lechner, ![Foo] works, but probably does not what you want, because it only evaluates until the first `:`. |
| 2021-07-29 16:32:09 | <kritzefitz> | lechner, [!Foo] is not valid syntax. |
| 2021-07-29 16:32:19 | × | wei2912 quits (~wei2912@112.199.250.21) (Quit: Lost terminal) |
| 2021-07-29 16:32:34 | × | fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 240 seconds) |
| 2021-07-29 16:32:48 | <kritzefitz> | If you want strict lists, you need a type that is explicitly designed to be a strict list or possibly define it yourself. |
| 2021-07-29 16:32:58 | → | fossdd joins (~fossdd@sourcehut/user/fossdd) |
| 2021-07-29 16:33:03 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 2021-07-29 16:33:17 | <kritzefitz> | But I *don't* think strictness annotations should have any effect on JSON parsing. |
| 2021-07-29 16:33:27 | <kritzefitz> | So it probably doesn't matter. |
| 2021-07-29 16:33:39 | <lechner> | so i have known valid JSON. migrating to Haskell, my definitions are probably off but the error message is not great |
| 2021-07-29 16:33:41 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-29 16:33:50 | <motle> | yeah, idk was thinking lazy IO if it was escapable and needed prompt evaluation or something |
| 2021-07-29 16:34:14 | <lechner> | i saw a note one time in a haskell project asking all contributors to use ! |
| 2021-07-29 16:34:32 | <motle> | you should have a good reason |
| 2021-07-29 16:34:39 | <motle> | never normally needed |
| 2021-07-29 16:35:27 | <motle> | really rare times where otherwise something gets dropped in a monadic sequence needing ! cat remember |
| 2021-07-29 16:36:06 | <motle> | but like, only encountering actual use cases of ! rarely, so not really seeing why anyone would emphasize its importance |
| 2021-07-29 16:36:32 | <lechner> | unfortunately i cannot find it anymore |
| 2021-07-29 16:36:42 | <kritzefitz> | There is another case with libraries such as Data.Binary, where the decoding function doesn't check for errors in favour of more laziness. |
| 2021-07-29 16:36:56 | <motle> | saw some thing about performant parallel from some london bank in haskell, strict on the spine lazy on the branches i think |
| 2021-07-29 16:37:33 | <kritzefitz> | In that case strictness annotations actually make a big difference, because an all-strict structure will throw errors earlier. |
| 2021-07-29 16:37:42 | → | KUrare joins (~KUrare@user/kurare) |
| 2021-07-29 16:38:10 | × | KUrare quits (~KUrare@user/kurare) (Remote host closed the connection) |
| 2021-07-29 16:38:11 | <motle> | ah right, like if it does a bunch of work before calling the next lazy value |
| 2021-07-29 16:38:22 | <motle> | in a sequence that will eventually fail or something like that |
| 2021-07-29 16:38:30 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 2021-07-29 16:39:00 | <motle> | so you would want to get everything into a pure environemnt first for example to avoid that source of errors |
| 2021-07-29 16:39:19 | <motle> | like reading all the values in from files before starting the processing |
| 2021-07-29 16:39:45 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 2021-07-29 16:39:53 | <motle> | so you would want to basically just use ! on the let bound variable capturing it from reading in from IO |
| 2021-07-29 16:40:26 | <motle> | and then just have everything else be lazy |
| 2021-07-29 16:40:33 | <motle> | idk about this stric list |
| 2021-07-29 16:40:41 | <motle> | to bind the functionality into the datatype like that |
| 2021-07-29 16:41:17 | <motle> | seems like you would have to have a different reason - like what were you saying, some kind of mapped error check? |
| 2021-07-29 16:41:25 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-29 16:41:38 | <motle> | i guess you could have a safe-strict-constructor |
| 2021-07-29 16:41:55 | <motle> | so that it performs all the safety checks to construct it at the same time |
| 2021-07-29 16:42:24 | <c_wraith> | as far as I'm concerned, the only reason to put strictness annotations into a constructor is when you need to unpack something of a known type for performance reasons. |
| 2021-07-29 16:42:25 | <motle> | or like, a strict fold using the safe constructor? |
| 2021-07-29 16:43:07 | <c_wraith> | otherwise it should be a property of functions that use that data and can set their own strictness policies appropriately for that exact use. |
| 2021-07-29 16:43:14 | <motle> | but then i dont see why you wouldnt just have a strict traversal with the error checker directly |
| 2021-07-29 16:43:50 | <maerwald[m]> | I use StrictData by default and so do many others |
| 2021-07-29 16:44:05 | <c_wraith> | StrictData doesn't even solve any interesting problems |
| 2021-07-29 16:44:15 | <c_wraith> | All it does is prevent using Haskell |
| 2021-07-29 16:44:35 | <motle> | lol, well if your usecase is known finite and totally evaluated |
| 2021-07-29 16:45:17 | <maerwald[m]> | No |
| 2021-07-29 16:45:24 | <motle> | so thats just like an easy switch to ensure recursive datatypes have everything like map performed strictly/simultaniously? |
| 2021-07-29 16:45:47 | <maerwald[m]> | https://github.com/yesodweb/wai/pull/752#issuecomment-501531386 |
| 2021-07-29 16:46:00 | <c_wraith> | StrictData is the equivalent of sticking ! on every field in data types defined in modules where it's enabled |
| 2021-07-29 16:46:30 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 276 seconds) |
| 2021-07-29 16:46:42 | <motle> | idk, everything i do is state encoded anyway... |
| 2021-07-29 16:47:11 | <c_wraith> | I don't get it. I don't have problems like that comment is talking about, because I make things the correct strictness up-front. |
| 2021-07-29 16:47:20 | <motle> | so basically definitely lazy! |
| 2021-07-29 16:47:22 | × | fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 240 seconds) |
| 2021-07-29 16:47:29 | <motle> | (as pottentially infinite as not yet unfolded) |
| 2021-07-29 16:47:48 | <c_wraith> | And I still get to do all the things that post ignores with knot-tying |
| 2021-07-29 16:47:50 | <motle> | just nyam everything up one at a time like pipes processing |
| 2021-07-29 16:47:51 | → | fossdd joins (~fossdd@sourcehut/user/fossdd) |
| 2021-07-29 16:48:06 | <motle> | + fusion. strictness seems to kill all of that! |
| 2021-07-29 16:48:19 | <motle> | no streams... |
| 2021-07-29 16:48:30 | <motle> | thats IO scanning out the window |
| 2021-07-29 16:48:49 | <motle> | strictly evaluate this stream of market data! |
| 2021-07-29 16:48:52 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.2) |
| 2021-07-29 16:49:19 | <motle> | i guess if you have a state encoded IO list though your gona be fine |
| 2021-07-29 16:49:36 | <motle> | i mean, the IO should allow stricness to be on by default? idk im confused |
| 2021-07-29 16:50:02 | <lechner> | it looks like aeson also offers strict parsers with json' and decode': http://winterland.me/2019/03/05/aeson%27s-mysterious-lazy-parsing/index.html |
| 2021-07-29 16:50:15 | <motle> | i still think i need it to be lazy because everythings these partially suspended traversals |
| 2021-07-29 16:50:21 | <motle> | yeah thats it |
| 2021-07-29 16:50:48 | <motle> | scanning is almost like a zipper, using lazyness at the front of evaluation by tail calls |
| 2021-07-29 16:51:08 | <motle> | so you need to "do the work" on a per value basis |
| 2021-07-29 16:51:31 | <motle> | and this will happen whenever your unfolding |
| 2021-07-29 16:51:41 | <motle> | er, if the unfolds may be infinite |
| 2021-07-29 16:51:52 | <motle> | so you cant be using streaming unfolds is basically all i can conclude |
| 2021-07-29 16:52:12 | × | fluffyballoon quits (~fluffybal@pat-verona-h.epic.com) (Quit: Client closed) |
| 2021-07-29 16:52:50 | <motle> | id say thats enough to call stric by default unidiomatic to some extent |
| 2021-07-29 16:52:58 | → | fluffyballoon joins (~fluffybal@pat-verona-h.epic.com) |
| 2021-07-29 16:53:32 | <motle> | assuming that folding/unfolding lazy lists is what we do |
| 2021-07-29 16:53:55 | × | drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 268 seconds) |
| 2021-07-29 16:54:03 | <motle> | i guess the division is between people with finite datatypes or not |
| 2021-07-29 16:54:28 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 2021-07-29 16:54:38 | <motle> | eg a fixed size fluid simulation compared to a live IO interface |
| 2021-07-29 16:55:17 | <motle> | its only because of the markets that i ended up with these damn scanners |
| 2021-07-29 16:55:19 | <motle> | damn |
| 2021-07-29 16:55:26 | <motle> | probably not going to make any money |
| 2021-07-29 16:55:34 | <motle> | hope you like scanners everybody!! |
All times are in UTC.