Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-31 20:05:14 × kritzefitz_ quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-03-31 20:06:14 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-03-31 20:06:21 × geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 260 seconds)
2021-03-31 20:07:13 petersen joins (~petersen@redhat/juhp)
2021-03-31 20:09:08 <maerwald> computer scientists are to blame for most of our modern day problems
2021-03-31 20:10:17 × abrar quits (~abrar@static-108-30-103-121.nycmny.fios.verizon.net) (Quit: WeeChat 2.9)
2021-03-31 20:10:35 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
2021-03-31 20:10:38 <[exa]> (including computers)
2021-03-31 20:11:01 × Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 260 seconds)
2021-03-31 20:11:33 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-03-31 20:11:55 usr25 joins (~usr25@unaffiliated/usr25)
2021-03-31 20:12:17 <maerwald> I'm glad many high-IQ ppl waste their life on chess. That creates less problems for us.
2021-03-31 20:12:56 borne joins (~fritjof@200116b86411e500f7ed9fd86a2491f0.dip.versatel-1u1.de)
2021-03-31 20:13:38 kenran_ joins (~kenran@mue-88-130-62-062.dsl.tropolys.de)
2021-03-31 20:16:11 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-03-31 20:16:11 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
2021-03-31 20:16:15 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2021-03-31 20:16:35 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-03-31 20:18:11 v01d4lph4 joins (~v01d4lph4@223.190.20.92)
2021-03-31 20:18:27 × fancyremarker quits (~fancyrema@185.169.233.10) (Remote host closed the connection)
2021-03-31 20:18:47 × geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed)
2021-03-31 20:18:48 × hiroaki quits (~hiroaki@2a02:8108:8c40:2bb8:1351:13b7:f6af:b97a) (Ping timeout: 246 seconds)
2021-03-31 20:21:11 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 240 seconds)
2021-03-31 20:22:18 × v01d4lph4 quits (~v01d4lph4@223.190.20.92) (Ping timeout: 240 seconds)
2021-03-31 20:23:12 takuan joins (~takuan@178-116-218-225.access.telenet.be)
2021-03-31 20:23:51 <fryguybob> Is there a straight forward way to write "shortest" so that shortest [[1..], [1,2,3]] -> [1,2,3] ?
2021-03-31 20:25:01 × kenran quits (~kenran@mue-88-130-62-062.dsl.tropolys.de) (Quit: Lost terminal)
2021-03-31 20:25:41 <sclv> fryguybob: sure, just use `genericLength` and peano numbers, I think :-)
2021-03-31 20:25:54 <justsomeguy> Maybe by using a type other than list, that requries a finite length.
2021-03-31 20:25:58 <sclv> actually you can do it directly by induction
2021-03-31 20:26:24 <[exa]> fryguybob: experiment with `map tail`
2021-03-31 20:26:26 <sclv> pair each list with itself, using the first element as the "index"
2021-03-31 20:26:58 <sclv> if there's something for which the "index" is nil, return it, if not drop one from each index, repeat
2021-03-31 20:27:47 <fryguybob> I was thinking something silly like map head . sequence ...
2021-03-31 20:28:14 × stree quits (~stree@68.36.8.116) (Ping timeout: 260 seconds)
2021-03-31 20:28:17 <sclv> oh yeah can't imagine a fully golfed one, but i can imagine a "slick" looking one with generic peanos at least
2021-03-31 20:28:34 conal joins (~conal@64.71.133.70)
2021-03-31 20:30:11 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-03-31 20:31:10 hiroaki joins (~hiroaki@2a02:8108:8c40:2bb8:461b:1426:c666:74bc)
2021-03-31 20:33:24 <[exa]> concatIterate would help
2021-03-31 20:34:52 kenanmarasli joins (1fdf0dda@31.223.13.218)
2021-03-31 20:37:16 × supercoven quits (~Supercove@dsl-hkibng31-54fabd-233.dhcp.inet.fi) (Ping timeout: 260 seconds)
2021-03-31 20:38:13 × kenran_ quits (~kenran@mue-88-130-62-062.dsl.tropolys.de) (Quit: leaving)
2021-03-31 20:38:52 <kenanmarasli> I am having a bit of a terminology problem.
2021-03-31 20:38:53 <kenanmarasli> Why are *if* *else* *case* expressions in Haskell, but in C they are statements?
2021-03-31 20:39:28 <Rembane> kenanmarasli: Because Haskell doesn't have statements. This might actually be a lie, but it's a good lie imo.
2021-03-31 20:39:54 <maerwald> Rembane: it's not a lie
2021-03-31 20:40:00 <[exa]> kenanmarasli: counterexample-- in C, there's no sense doing `a = if (123) printf("123");`
2021-03-31 20:40:11 <ph88^> does anyone know how this site came into existence ? https://riptutorial.com/haskell
2021-03-31 20:40:30 × ubert quits (~Thunderbi@p200300ecdf25d9fde6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection)
2021-03-31 20:40:50 <Rembane> maerwald: Cool. Are the functions in a module expressions? Or are they something else?
2021-03-31 20:40:55 solidus-river joins (~mike@174.127.249.180)
2021-03-31 20:41:26 stree joins (~stree@68.36.8.116)
2021-03-31 20:41:32 <yushyin> declarations/definitions
2021-03-31 20:41:43 × Narinas quits (~Narinas@187-178-93-112.dynamic.axtel.net) (Read error: Connection reset by peer)
2021-03-31 20:41:52 <Rembane> Of course! Thank you!
2021-03-31 20:41:55 <solidus-river> hey all, i have to parse a bunch of binary blobs sent over the wire and each parse returns an Either Err Result. It winds up being an unwieldly number of nested case statements to parse is there a better way to do this syntactically?
2021-03-31 20:41:57 <maerwald> haskell report doesn't say anything about execution either
2021-03-31 20:42:04 <maerwald> it's not specified
2021-03-31 20:42:18 hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net)
2021-03-31 20:42:52 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
2021-03-31 20:42:56 <[exa]> solidus-river: attoparsec? (not sure how much "binary" it is but if it fits in bytestrings then attoparsec should just work)
2021-03-31 20:43:56 usr25 parts (~usr25@unaffiliated/usr25) ("Leaving")
2021-03-31 20:44:03 Narinas joins (~Narinas@187-178-93-112.dynamic.axtel.net)
2021-03-31 20:44:07 <ephemient> @hackage attoparsec
2021-03-31 20:44:07 <lambdabot> https://hackage.haskell.org/package/attoparsec
2021-03-31 20:44:11 <ephemient> @hackage binary
2021-03-31 20:44:11 <lambdabot> https://hackage.haskell.org/package/binary
2021-03-31 20:44:24 <[exa]> solidus-river: ah you already have the functions for parsing these, sorry. You might want to exploit the monad instance for Either then, it works like "returning Left means an error"
2021-03-31 20:45:40 <solidus-river> [exa]: ooo, the monad instance looks like exactly what I want, I can just print out the whole sequence on any error and then not worry so much about reporting exactly what failed to parse
2021-03-31 20:45:46 <ephemient> Either Err Result is in the correct order for that already, but I am not sure given the previous statement whether the awkwardness is in the parsing or in handling the parse result?
2021-03-31 20:47:20 <[exa]> solidus-river: it usually helps, given there's not much other complexity that would break it. Generally, you can rewrite your program with `do` statements, "bind" each Either with say `subResult <- parsingOperation`, and you get the "Right" type and can completely ignore Lefts
2021-03-31 20:47:31 <[exa]> if anything breaks, the first Left gets returned
2021-03-31 20:48:07 <[exa]> > do { a <- Right 5; b <- Right 3; Right (a+b); }
2021-03-31 20:48:09 <lambdabot> Right 8
2021-03-31 20:48:24 <[exa]> (you can use `return` or `pure` instead of the last `Right`)
2021-03-31 20:48:29 <[exa]> compare to:
2021-03-31 20:48:33 <[exa]> > do { a <- Right 5; b <- Left "sorry"; Right (a+b); }
2021-03-31 20:48:35 <lambdabot> Left "sorry"
2021-03-31 20:48:58 <solidus-river> i think the monad instance would collapse things nicely. I was being kinda derpy and logging each parse error nad the case statments were running of the right end of the screen. the do syntax looks tasty though, every error ends up being the same. I need to be better about reading how things are instanced that I'm using
2021-03-31 20:49:10 <kenanmarasli> Rembane: I see. Well for me it looks like I can think of these keywords in Haskell like they are wrapped in a function. *if* *else* eventually returns a value and that's why they are expressions. Is it correct?
2021-03-31 20:49:24 <solidus-river> side note, I don't think the monadic instance in zeromq4-haskell is actually usefull in a real world scenario.
2021-03-31 20:49:39 × Narinas quits (~Narinas@187-178-93-112.dynamic.axtel.net) (Read error: Connection reset by peer)
2021-03-31 20:49:58 <solidus-river> but I should also :X until I have a pr with a different instance to back my thoughts
2021-03-31 20:50:00 × Guest_17 quits (6029f825@096-041-248-037.res.spectrum.com) (Quit: Connection closed)
2021-03-31 20:50:20 <Rembane> kenanmarasli: Yeah, they evaluate to a value. Both branches evaluate to values of the same type too which is a nice property.
2021-03-31 20:50:25 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2021-03-31 20:50:49 <solidus-river> * not actually useful
2021-03-31 20:51:00 <kenanmarasli> Thank you :)
2021-03-31 20:51:08 <Rembane> np :)
2021-03-31 20:51:22 × son0p quits (~son0p@181.136.122.143) (Quit: Lost terminal)
2021-03-31 20:52:09 <[exa]> solidus-river: it may be good for demos. it kinda reminds me the Action monad from Scotty (takes care about simple mistakes, causes trouble later)
2021-03-31 20:52:30 Narinas joins (~Narinas@187-178-93-112.dynamic.axtel.net)
2021-03-31 20:53:24 <[exa]> (/me -> afk)
2021-03-31 20:53:47 × stree quits (~stree@68.36.8.116) (Quit: Caught exception)
2021-03-31 20:54:08 <sm2n> kenanmarasli, [exa], note that the C example could return a value, it is just that C was designed not to
2021-03-31 20:54:09 stree joins (~stree@68.36.8.116)
2021-03-31 20:54:40 <sm2n> most lisps will return a value in that example, for example
2021-03-31 20:54:47 <sm2n> C is just not very compositional
2021-03-31 20:54:50 <wz1000> is there a variant of Data.Sequence on hackage that is strict in the elements?

All times are in UTC.