Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-15 14:56:09 <p0a> I see
2020-11-15 14:56:28 <p0a> I did write something with strict IO that works fine
2020-11-15 14:56:33 <p0a> I was just trying to see what lazy IO is about
2020-11-15 14:56:56 <p0a> I was also recommended conduit which was the next thing I was going to look at
2020-11-15 14:57:23 machinedgod joins (~machinedg@24.105.81.50)
2020-11-15 14:57:33 <nshepperd2> well, with lazy IO, what you get is a big lazy bytestring which contains the entire input
2020-11-15 14:58:27 <nshepperd2> what you'd generally do is write a pure function which transforms that into a bytestring containing the entire output
2020-11-15 14:58:33 <p0a> I don't know why I ran into Get, I guess I don't need it at all, you just made me realize.
2020-11-15 14:58:33 jakalx joins (~jakalx@base.jakalx.net)
2020-11-15 14:59:30 × FTB quits (5f5ac942@ip5f5ac942.dynamic.kabel-deutschland.de) (Remote host closed the connection)
2020-11-15 14:59:32 <nshepperd2> and then just call Data.ByteString.Lazy.putStr to write that to stdout
2020-11-15 15:00:02 × JohnONolan quits (~JohnONola@193.56.252.12) ()
2020-11-15 15:00:10 <p0a> right, thank you
2020-11-15 15:00:21 <p0a> I was misled by what the purpose of `binary' is
2020-11-15 15:01:51 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-11-15 15:02:45 jakalx parts (~jakalx@base.jakalx.net) ("Disconnected: closed")
2020-11-15 15:03:01 jakalx joins (~jakalx@base.jakalx.net)
2020-11-15 15:07:29 lucasb joins (uid333435@gateway/web/irccloud.com/x-vbpjdjtpfxqmyplf)
2020-11-15 15:07:46 × jakalx quits (~jakalx@base.jakalx.net) (Ping timeout: 256 seconds)
2020-11-15 15:13:49 avdb joins (~avdb@ip-83-134-109-106.dsl.scarlet.be)
2020-11-15 15:14:52 × cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Quit: cosimone)
2020-11-15 15:16:57 × HaskellYogi quits (~vivekrama@49.207.219.163) (Remote host closed the connection)
2020-11-15 15:17:09 christo joins (~chris@81.96.113.213)
2020-11-15 15:17:25 nbloomf joins (~nbloomf@2600:1700:ad14:3020:c56c:6f1e:9a5c:a8b9)
2020-11-15 15:17:39 HaskellYogi joins (~vivekrama@49.207.219.163)
2020-11-15 15:18:57 jakalx joins (~jakalx@base.jakalx.net)
2020-11-15 15:23:37 × jakalx quits (~jakalx@base.jakalx.net) (Ping timeout: 264 seconds)
2020-11-15 15:24:10 × HaskellYogi quits (~vivekrama@49.207.219.163) (Remote host closed the connection)
2020-11-15 15:24:26 HaskellYogi joins (~vivekrama@49.207.219.163)
2020-11-15 15:24:38 jduhamel joins (~textual@bras-base-toroon4664w-grc-14-184-145-124-162.dsl.bell.ca)
2020-11-15 15:32:05 × HaskellYogi quits (~vivekrama@49.207.219.163) (Quit: Sayonara. Long live Haskell)
2020-11-15 15:33:49 × Inoperable quits (~PLAYER_1@fancydata.science) (Excess Flood)
2020-11-15 15:38:49 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-11-15 15:39:03 × jaspervdj quits (~jaspervdj@213.55.241.138) (Quit: leaving)
2020-11-15 15:40:02 Inoperable joins (~PLAYER_1@fancydata.science)
2020-11-15 15:41:16 urodna joins (~urodna@unaffiliated/urodna)
2020-11-15 15:41:51 × wei2912 quits (~wei2912@unaffiliated/wei2912) (Remote host closed the connection)
2020-11-15 15:42:17 × ericsagn1 quits (~ericsagne@2405:6580:0:5100:f576:66f7:e38e:c2d0) (Ping timeout: 260 seconds)
2020-11-15 15:42:34 jamm_ joins (~jamm@unaffiliated/jamm)
2020-11-15 15:42:45 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
2020-11-15 15:43:23 × coeus quits (~coeus@p200300d0273fc6004bc0c1d283592f2f.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
2020-11-15 15:45:53 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-11-15 15:47:31 <dminuoso> I have a typeclass for serialization with a method `putAttr :: Attr a => a -> (Word32 -> Put -> Put) -> Put` with the assumption that an implementor will do something like `putAttr (SomeThing s) h = h 16 (putThing s)`
2020-11-15 15:48:24 <dminuoso> The idea is that this continuation lets us communicate to the caller the length of our attribute, such that they can use it in some manner.
2020-11-15 15:48:52 <dminuoso> However, that signature doesn't actually enforce it, since you could accidentally just write `putAttr (SomeThing s) _ = putThing s`
2020-11-15 15:49:24 <dminuoso> Is there a way to rewrite this method to make it less error prone in that sense?
2020-11-15 15:49:26 <ski> `putAttr :: Attr a => a -> (Word32 -> Put -> o) -> o' ?
2020-11-15 15:49:28 coot joins (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl)
2020-11-15 15:49:44 <dminuoso> Oh.
2020-11-15 15:50:18 × pavonia quits (~user@unaffiliated/siracusa) (Quit: Bye!)
2020-11-15 15:50:26 <dminuoso> ski: Why didn't I see that, cheers!
2020-11-15 15:50:35 <ski> oh, it'll work ?
2020-11-15 15:50:48 <dminuoso> Looks perfectly reasonable I guess?
2020-11-15 15:51:08 <dminuoso> Let me play with it
2020-11-15 15:51:17 <ski> it depends on whether you expect `putAttr' to always be in CPS, or else sometimes nqCPS
2020-11-15 15:51:38 <ski> (and i don't know enough context to be able to tell that)
2020-11-15 15:51:40 <dminuoso> What is nqCPS?
2020-11-15 15:51:50 <ski> "not-quite CPS"
2020-11-15 15:52:05 <dminuoso> So far, I intend to use this in CPS everywhere
2020-11-15 15:52:19 <ski> like you sometimes "do something after the continuation". e.g. using `finally' or `bracket'
2020-11-15 15:53:33 <ski> e.g. `Codensity IO a' enforces that the only "not quite" things you can do are general `IO' things (that are polymorphic in the result type)
2020-11-15 15:53:37 britva joins (~britva@2a02:aa13:7240:2980:bc4b:509a:98e6:5bb0)
2020-11-15 15:54:25 <dminuoso> Think I might just have to start using Cont here.
2020-11-15 15:54:28 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds)
2020-11-15 15:54:41 ericsagn1 joins (~ericsagne@2405:6580:0:5100:dcdb:fdc1:bfe:ca10)
2020-11-15 15:54:50 <dminuoso> Perhaps the the explicit and manual CPS is just too thick to look through
2020-11-15 15:55:01 paolo|out joins (~paolo|out@185.163.110.116)
2020-11-15 15:55:02 <ski> (of course, one could also imagine `putAttr :: Attr a => a -> (Word32,Put)' (or even `putAttr# :: Attr a => a -> (# Word32,Put #)') .. but presumably the ergonomics of CPS is nicer, in your case
2020-11-15 15:55:19 <ski> )
2020-11-15 15:55:21 <dminuoso> Yeah, the ergonomics of CPS is a lot nicer indeed.
2020-11-15 15:55:34 p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515)
2020-11-15 15:55:36 kuribas joins (~user@ptr-25vy0i7amf8n4ydxgty.18120a2.ip6.access.telenet.be)
2020-11-15 15:55:45 <dminuoso> (I tried it with the above, and there were bizarre edge cases I couldn't quite figure out)
2020-11-15 15:56:07 <dminuoso> Plus, I have the need to callWithCC soon
2020-11-15 15:56:15 <kuribas> since many libraries use CPS for exceptions (like attoparsec), wouldn't it be useful to have a ExceptT library that uses CPS?
2020-11-15 15:56:33 <dminuoso> Err, callCC I guess its called in Haskell
2020-11-15 15:57:59 f-a joins (~f-a@151.68.244.218)
2020-11-15 15:58:02 f-a parts (~f-a@151.68.244.218) ()
2020-11-15 15:58:11 <ski> hm. i wonder how you're intending to capture and later swap out the current continuation
2020-11-15 15:58:35 bangtree joins (~user@50-102-199-84.ekht.in.frontiernet.net)
2020-11-15 15:59:48 coeus joins (~coeus@p200300d027453600d114986072cc2eb8.dip0.t-ipconnect.de)
2020-11-15 16:00:00 <dminuoso> ski: Very roughly, the protocol demands to serializen an "attribute" into an "invalid attribute" (which would not invalidate the entire pass) under certain conditions.
2020-11-15 16:00:05 × zerstroyer[m] quits (zerstroyer@gateway/shell/matrix.org/x-jrgpqmwjlqykhxer) (Quit: Idle for 30+ days)
2020-11-15 16:00:48 <dminuoso> Oh wait..
2020-11-15 16:00:51 <dminuoso> That's in the Get part...
2020-11-15 16:00:53 <dminuoso> mmm
2020-11-15 16:01:20 FreeBirdLjj joins (~freebirdl@101.228.42.108)
2020-11-15 16:01:47 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-15 16:02:50 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2020-11-15 16:03:16 boxscape joins (54a35f37@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.95.55)
2020-11-15 16:03:56 alp joins (~alp@2a01:e0a:58b:4920:a992:8ca9:416:3a9e)
2020-11-15 16:04:11 <Iceland_jack> hi alp
2020-11-15 16:04:38 <alp> hello
2020-11-15 16:04:53 × bangtree quits (~user@50-102-199-84.ekht.in.frontiernet.net) (Ping timeout: 260 seconds)
2020-11-15 16:06:12 × FreeBirdLjj quits (~freebirdl@101.228.42.108) (Ping timeout: 256 seconds)
2020-11-15 16:06:33 × shangxiao quits (~davids@101.181.159.140) (Quit: WeeChat 2.9)
2020-11-15 16:08:42 × berberman_ quits (~berberman@unaffiliated/berberman) (Quit: ZNC 1.7.5 - https://znc.in)
2020-11-15 16:09:05 berberman joins (~berberman@unaffiliated/berberman)
2020-11-15 16:16:29 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
2020-11-15 16:17:37 elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)

All times are in UTC.