Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-23 14:00:15 lxsameer joins (lxsameer@gateway/vpn/protonvpn/lxsameer)
2020-11-23 14:00:23 resolve joins (~resolve@178.162.212.214)
2020-11-23 14:01:39 <tomsmeding> PacoV: 👋
2020-11-23 14:08:08 qwfpmluy joins (2e0505e2@HSI-KBW-046-005-005-226.hsi8.kabel-badenwuerttemberg.de)
2020-11-23 14:08:44 hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net)
2020-11-23 14:10:38 boxscape joins (86ab2c1f@gateway/web/cgi-irc/kiwiirc.com/ip.134.171.44.31)
2020-11-23 14:12:25 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2020-11-23 14:17:42 vicfred joins (~vicfred@unaffiliated/vicfred)
2020-11-23 14:18:05 Achylles joins (~Achylles@177.45.205.205)
2020-11-23 14:18:14 × cur8or quits (~cur8or@72canterbury.cybersmart.co.za) (Ping timeout: 256 seconds)
2020-11-23 14:18:55 × Achylles quits (~Achylles@177.45.205.205) (Max SendQ exceeded)
2020-11-23 14:19:25 Achylles joins (~Achylles@177.45.205.205)
2020-11-23 14:21:57 × Achylles quits (~Achylles@177.45.205.205) (Max SendQ exceeded)
2020-11-23 14:22:19 mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de)
2020-11-23 14:22:33 son0p joins (~son0p@181.136.122.143)
2020-11-23 14:22:36 × phaul quits (~phaul@ruby/staff/phaul) (Ping timeout: 240 seconds)
2020-11-23 14:23:52 Achylles joins (~Achylles@177.45.205.205)
2020-11-23 14:24:58 phaul joins (~phaul@ruby/staff/phaul)
2020-11-23 14:26:17 <qwfpmluy> what are the best resources for learning about the different ways of doing `deriving` (deriving via, standalone deriving, ...) in haskell?
2020-11-23 14:28:09 <boxscape> I think the User Guide, starting here, is a decent resource https://downloads.haskell.org/ghc/latest/docs/html/users_guide/glasgow_exts.html#generalised-derived-instances-for-newtypes
2020-11-23 14:28:39 <boxscape> (actually standalone deriving is a bit further up)
2020-11-23 14:31:11 <Uniaika> I wonder if Kowainik didn't make a short guide on that
2020-11-23 14:31:31 <lyxia> qwfpmluy: https://kowainik.github.io/posts/deriving
2020-11-23 14:31:42 <Uniaika> glorious, thanks lyxia
2020-11-23 14:31:55 <lyxia> Uniaika: :P
2020-11-23 14:32:08 <Uniaika> :9
2020-11-23 14:32:21 <hseg> tomsmeding: fair. i use unqualified imports more frequently in ghci for this reason
2020-11-23 14:32:56 <tomsmeding> ghci is playground anyway :)
2020-11-23 14:33:56 × cads quits (~cads@ip-64-72-99-232.lasvegas.net) (Ping timeout: 240 seconds)
2020-11-23 14:33:58 <qwfpmluy> boxscape lyxia thanks!
2020-11-23 14:34:36 <hseg> exactly
2020-11-23 14:34:43 <hseg> any other recs?
2020-11-23 14:34:56 <hseg> feel my recursion is a bit ad-hoc
2020-11-23 14:36:01 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
2020-11-23 14:36:06 cads joins (~cads@ip-64-72-99-232.lasvegas.net)
2020-11-23 14:36:56 × phaul quits (~phaul@ruby/staff/phaul) (Ping timeout: 240 seconds)
2020-11-23 14:37:18 coot joins (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl)
2020-11-23 14:37:24 Fractalis joins (~Fractalis@2601:987:280:8d40:eda9:f9e1:2072:cea7)
2020-11-23 14:37:39 mpereira joins (~mpereira@2a02:810d:f40:d96:1ca0:7a83:5454:b1ba)
2020-11-23 14:38:00 hackage prolude 0.0.0.10 - ITProTV's custom prelude https://hackage.haskell.org/package/prolude-0.0.0.10 (saramuse)
2020-11-23 14:42:53 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2020-11-23 14:44:53 phaul joins (~phaul@ruby/staff/phaul)
2020-11-23 14:45:05 falafel joins (~falafel@2601:547:1303:b30:7811:313f:d0f3:f9f4)
2020-11-23 14:48:25 × sheb quits (~Thunderbi@77.244.36.161) (Ping timeout: 240 seconds)
2020-11-23 14:48:34 × geekosaur quits (ac3a8b3a@172.58.139.58) (Remote host closed the connection)
2020-11-23 14:49:32 kish` joins (~oracle@unaffiliated/oracle)
2020-11-23 14:49:44 sheb joins (~Thunderbi@77.244.36.161)
2020-11-23 14:49:53 × larou quits (5eae2591@gateway/web/cgi-irc/kiwiirc.com/ip.94.174.37.145) (Quit: Connection closed)
2020-11-23 14:51:32 × xff0x quits (~fox@2001:1a81:5237:b800:d8c8:bfa0:43f3:b736) (Ping timeout: 260 seconds)
2020-11-23 14:51:58 xff0x joins (~fox@2001:1a81:5237:b800:aac7:5690:7e90:eba4)
2020-11-23 14:52:14 × da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:6c06:c056:20b8:f8ee:6530) (Ping timeout: 264 seconds)
2020-11-23 14:52:14 × chaosmasttter quits (~chaosmast@p200300c4a72cf80165f6d709b523305b.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2020-11-23 14:53:06 da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:6c06:c056:20b8:f8ee:6530)
2020-11-23 14:53:53 <boxscape> hmm, I'm idly wondering if there is some way to take a non-IO value and unsafeCoerce it to print a non-empty string to the terminal
2020-11-23 14:54:02 <boxscape> I suppose there has to be
2020-11-23 14:54:16 × tabemann quits (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) (Remote host closed the connection)
2020-11-23 14:54:54 Sheilong joins (uid293653@gateway/web/irccloud.com/x-lkssxccumhdupnut)
2020-11-23 14:57:57 <tomsmeding> hseg: I haven't even tried to compile this, but theoretically this should do the same as yours? https://paste.tomsmeding.com/FbLBhrVM
2020-11-23 14:58:23 <tomsmeding> using ! instead of !? I do assume that the permutation is valid, i.e. doesn't contain out of bounds values
2020-11-23 14:58:50 × falafel quits (~falafel@2601:547:1303:b30:7811:313f:d0f3:f9f4) (Ping timeout: 264 seconds)
2020-11-23 14:58:54 tabemann joins (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net)
2020-11-23 15:00:14 <dminuoso> boxscape: Do you mean Debug.Trace.trace ?
2020-11-23 15:00:22 <dminuoso> That's not quite unsafeCoerce though.
2020-11-23 15:01:20 <boxscape> dminuoso well, basically what I'm looking for (for no particular reason) is something like (unsafeCoerce (23874893274 :: Integer) :: IO ()), which, when bound to main, prints "hello" to the terminal, or whatever
2020-11-23 15:01:44 <merijn> boxscape: You are a bad person and you should feel bad >.>
2020-11-23 15:01:45 <dminuoso> How is that even remotely related to unsafeCoerce... ?
2020-11-23 15:01:52 <boxscape> merijn sorry :(
2020-11-23 15:01:53 <merijn> dminuoso: l33t ahx
2020-11-23 15:01:58 <merijn> s/ahx/hax
2020-11-23 15:02:16 <dminuoso> boxscape: Why should that print "hello" and not "goodbye"?
2020-11-23 15:02:19 <merijn> dminuoso: Like those people who write C, but main is a char* whose values happen to be sensible code
2020-11-23 15:02:30 <boxscape> dminuoso because the number is carefully chosen
2020-11-23 15:02:38 <boxscape> (though my example is random)
2020-11-23 15:02:49 <dminuoso> boxscape: Maybe you should elaborate on that "carefully chosen"
2020-11-23 15:02:55 <dminuoso> because so far you didn't mentoin this
2020-11-23 15:03:11 <dminuoso> All I got was "I want `unsafeCoerce a` to turn it into a printing thing"
2020-11-23 15:03:13 × alp quits (~alp@2a01:e0a:58b:4920:e13d:1293:cf10:eb67) (Ping timeout: 272 seconds)
2020-11-23 15:03:13 <dminuoso> :p
2020-11-23 15:03:15 <merijn> dminuoso: He wants to figure out how to pick a value, such that unsafeCoerce leads toe xecutable code
2020-11-23 15:03:29 <boxscape> dminuoso The essence of my wondering is exactly how to find such a value (and I suppose a type that supports it)
2020-11-23 15:03:48 <dolio> I think that might not even be possible.
2020-11-23 15:03:57 <dminuoso> boxscape: unsafePerformIO does it for you.
2020-11-23 15:03:57 <boxscape> hmm what makes you say that?
2020-11-23 15:04:06 <dminuoso> Or.. wait no. IO is that thing.
2020-11-23 15:04:49 <tomsmeding> boxscape: I think the problem you're going to run into is that a valid valid of type IO a is going to have lots of pointers in it
2020-11-23 15:04:51 <dminuoso> boxscape: For starters you have no knowledge of the hepa
2020-11-23 15:04:58 <dminuoso> *heap
2020-11-23 15:05:01 <dolio> Because there'd be no closure layout for an integer that actually matches an IO thing.
2020-11-23 15:05:13 <dolio> Or any other type, really.
2020-11-23 15:05:16 <boxscape> hmm okay
2020-11-23 15:05:32 <tomsmeding> a ByteArray# could perhaps accidentally match something?
2020-11-23 15:05:38 <dminuoso> ByteArray# lives on the heap too.
2020-11-23 15:05:46 <tomsmeding> sure, but an IO value does too
2020-11-23 15:05:58 <tomsmeding> and embedded pointers will go wrong though
2020-11-23 15:06:47 × NieDzejkob quits (~quassel@188.123.215.55) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2020-11-23 15:07:34 elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)
2020-11-23 15:07:53 NieDzejkob joins (~quassel@188.123.215.55)
2020-11-23 15:08:08 <dminuoso> My feeling tells me boxscape lied about the "for no particular reason" part.
2020-11-23 15:08:13 <hseg> tomsmeding: yeah, that looks great! my code is an object example of tunnel-visioned use of One Trick(TM)
2020-11-23 15:08:20 <dminuoso> boxscape: Are you trying to be really sneaky?

All times are in UTC.