Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 508 509 510 511 512 513 514 515 516 517 518 .. 5022
502,152 events total
2020-10-08 12:50:28 hackage stylish-haskell 0.12.2.0 - Haskell code prettifier https://hackage.haskell.org/package/stylish-haskell-0.12.2.0 (JasperVanDerJeugt)
2020-10-08 12:50:57 <carbolymer> [exa], to spawn new threads when pushing things to avoid blocking?
2020-10-08 12:50:57 jonatanb joins (~jonatanb@79.184.190.239.ipv4.supernova.orange.pl)
2020-10-08 12:51:47 <[exa]> carbolymer: yeah, the threads are cheap and the internal eventloop is pretty good. you may also check the rabbitmq wrapper, I'd expect that it already does something like that internally
2020-10-08 12:51:57 hackage network-transport-tests 0.3.0 - Unit tests for Network.Transport implementations https://hackage.haskell.org/package/network-transport-tests-0.3.0 (FacundoDominguez)
2020-10-08 12:52:38 <[exa]> troydm: can you share a bit of code that doesn't work? (first guess, are you writing the instance of Show?)
2020-10-08 12:54:36 × __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving)
2020-10-08 12:55:21 <carbolymer> [exa], you mean amqp library? the publishMsg pushes message to mvar and blocks, hence why I want to wrap it in async
2020-10-08 12:56:14 <troydm> [exa]: https://pastebin.com/BZ08cd7X
2020-10-08 12:56:17 <troydm> [exa]: yes
2020-10-08 12:56:38 aarvar joins (~foewfoiew@50.35.43.33)
2020-10-08 12:56:39 <[exa]> carbolymer: maybe better have a channel for throwing the messages at, and a "worker thread" that just forwards the stuff to publishMsg ?
2020-10-08 12:57:37 <carbolymer> [exa], yep, but if those threads are so "green" is it worth the effort to implement this "worker thread"?
2020-10-08 12:57:51 <[exa]> carbolymer: I wouldn't bother until there's a proof that it's too slow
2020-10-08 12:58:05 <carbolymer> [exa], that's exactly my reasoning ;)
2020-10-08 12:58:07 <[exa]> how many thousand messages per second do you want to pass through? :D
2020-10-08 12:58:26 <jackdk> sshine: if you're doing languagey-stuff with recursion schemes, this post might interest you: http://newartisans.com/2018/04/win-for-recursion-schemes/
2020-10-08 12:58:33 × knupfer quits (~Thunderbi@200116b82ce4df004016f923e09abad3.dip.versatel-1u1.de) (Quit: knupfer)
2020-10-08 12:58:42 knupfer joins (~Thunderbi@200116b82ce4df0065b7390434ba158b.dip.versatel-1u1.de)
2020-10-08 12:59:05 <carbolymer> [exa], a dozen of messages per second in high traffic ;]
2020-10-08 12:59:18 <[exa]> troydm: okay, you need to write a Show behind the =>, this way you are instancing IOUArray typeclass
2020-10-08 12:59:28 <[exa]> carbolymer: </care>
2020-10-08 12:59:43 <carbolymer> yeah
2020-10-08 13:00:17 <troydm> [exa]: oic
2020-10-08 13:00:48 <[exa]> troydm: I guess the instance should read "If the HType e is showable, IOUArray i e should also be showable" right?
2020-10-08 13:01:33 <troydm> [exa]: yeah, well, sometimes I have no idea what I'm writing and if it compiles it usually works, but I have no idea how it works
2020-10-08 13:02:33 <troydm> [exa]: I just need to make instance of IOUArray Int64 HType showable
2020-10-08 13:02:44 <troydm> [exa]: and I'm bit struggling
2020-10-08 13:02:52 × chaosmasttter quits (~chaosmast@p200300c4a70b40010854fe5f0255a133.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2020-10-08 13:03:16 cpressey joins (~cpressey@79-72-202-104.dynamic.dsl.as9105.com)
2020-10-08 13:03:28 <[exa]> troydm: you are using HType there as a higher-order type constant, which it is not. I guess you want:
2020-10-08 13:03:30 × seanvert quits (~user@177.84.244.242) (Read error: Connection reset by peer)
2020-10-08 13:03:37 <sshine> jackdk, thanks! I am.
2020-10-08 13:04:10 <[exa]> troydm: instance Show e => Show (IOUArray i e) where .... (which says "IOUArray of e's is showable if there's a way of showing he e's)
2020-10-08 13:04:28 <[exa]> *the
2020-10-08 13:05:05 × Gurkenglas_ quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 240 seconds)
2020-10-08 13:06:05 <sshine> jackdk, excellent article, thank you. :)
2020-10-08 13:06:13 <sshine> jackdk, I
2020-10-08 13:06:20 <sshine> jackdk, I'll look into it and do a comparison.
2020-10-08 13:06:26 <troydm> [exa]: Could not deduce (MArray IOUArray e [])
2020-10-08 13:06:28 <troydm> arising from a use of ‘getElems’
2020-10-08 13:06:33 <troydm> [exa]: is what I get
2020-10-08 13:06:45 <troydm> [exa]: when I change it to what you've suggested
2020-10-08 13:06:52 <[exa]> ok we're getting closer
2020-10-08 13:07:03 <troydm> [exa]: which is a bit confusing
2020-10-08 13:07:09 chaosmasttter joins (~chaosmast@p200300c4a70b40010854fe5f0255a133.dip0.t-ipconnect.de)
2020-10-08 13:07:33 <[exa]> it also needs some assurance that you are not running this on an array that wouldn't have a workable getElems
2020-10-08 13:08:01 jneira_ joins (~jneira@118.red-176-83-71.dynamicip.rima-tde.net)
2020-10-08 13:08:26 <[exa]> troydm: (also that `i` is an actual index as in Ix )
2020-10-08 13:08:51 <[exa]> you can have a look at the type of getElems here https://hackage.haskell.org/package/array-0.5.4.0/docs/Data-Array-MArray.html#v:getElems to see how much assurance it requires to work
2020-10-08 13:08:56 jedws joins (~jedws@121.209.161.98)
2020-10-08 13:10:14 <[exa]> you actually need to declare your typeclass instance with the same (or stricter) conditions, because otherwise you'd be "promising" to deliver instances that can not work
2020-10-08 13:11:42 AlterEgo- joins (~ladew@124-198-158-163.dynamic.caiway.nl)
2020-10-08 13:12:17 <[exa]> so in our case, the instance should read, very roughly: If `i` is an Ix index, if `e` is showable by Show, and if the IOUArray forms a `MArray IOUArray e m` for some `m`, you can also show `IOUArray i e`
2020-10-08 13:12:23 × shatriff quits (~vitaliish@88.155.84.139) (Remote host closed the connection)
2020-10-08 13:13:23 × hololeap quits (~hololeap@unaffiliated/hololeap) (Ping timeout: 240 seconds)
2020-10-08 13:13:51 <[exa]> now you should notice the obvious problem; `getElems` is a monadic action of the monad `m`, I'm not sure you'll be able to fit that into a normal `show` that must return a "pure" String
2020-10-08 13:16:01 <troydm> [exa]: No instance for (MArray IOUArray HType []) <= what's [] in this?
2020-10-08 13:16:13 ddellacosta joins (~dd@86.106.121.168)
2020-10-08 13:16:35 Habib joins (~Habib@178.239.161.88)
2020-10-08 13:16:45 <[exa]> troydm: you are trying to use `map show` on `m e` returned from getElems, so it assumes that you know what are you doing and that m==[]
2020-10-08 13:17:07 × chaosmasttter quits (~chaosmast@p200300c4a70b40010854fe5f0255a133.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2020-10-08 13:17:12 <troydm> [exa]: ohh fuck I've missed that m a part of getElems
2020-10-08 13:17:14 <[exa]> obviously that MArray instance does not exist, I assume it will require `m` to be IO or something similarly powerful
2020-10-08 13:17:26 <troydm> [exa]: are there any good MArray examples out there
2020-10-08 13:17:51 <[exa]> yeah, as MVector... :]
2020-10-08 13:17:57 <troydm> ohh I've could do the obvious, unsafeIOPerform
2020-10-08 13:18:03 <[exa]> please don't :D
2020-10-08 13:18:16 <[exa]> btw why do you need the thing mutable?
2020-10-08 13:19:12 <troydm> [exa]: well I'm trying to write R7RS scheme interpreter, so I need a vector elements to be mutable
2020-10-08 13:19:26 seanvert joins (~user@177.84.244.242)
2020-10-08 13:19:47 spew joins (uid195861@gateway/web/irccloud.com/x-ypeilgetepuhkpyp)
2020-10-08 13:22:24 <troydm> [exa]: well, even with unsafePerformIO, I get No instance for (MArray IOUArray HType IO)
2020-10-08 13:23:07 <dminuoso> Is there a way to have `foo $ \do -> \n ...` with the following block at the same indention as `foo`?
2020-10-08 13:23:23 <dminuoso> I have the problem of deeply nested callbacks here
2020-10-08 13:23:28 <dminuoso> Or is ContT my only solution here?
2020-10-08 13:24:33 × knupfer quits (~Thunderbi@200116b82ce4df0065b7390434ba158b.dip.versatel-1u1.de) (Quit: knupfer)
2020-10-08 13:24:46 knupfer joins (~Thunderbi@200116b82ce4df007893e071bdb5e1dd.dip.versatel-1u1.de)
2020-10-08 13:25:50 knupfer1 joins (~Thunderbi@200116b82ce4df00b8b6b0ef9e67ac14.dip.versatel-1u1.de)
2020-10-08 13:25:51 × knupfer quits (~Thunderbi@200116b82ce4df007893e071bdb5e1dd.dip.versatel-1u1.de) (Read error: Connection reset by peer)
2020-10-08 13:25:51 knupfer1 is now known as knupfer
2020-10-08 13:26:42 × knupfer quits (~Thunderbi@200116b82ce4df00b8b6b0ef9e67ac14.dip.versatel-1u1.de) (Client Quit)
2020-10-08 13:26:51 knupfer joins (~Thunderbi@200116b82ce4df00300ce483b7c28dd1.dip.versatel-1u1.de)
2020-10-08 13:28:08 mav1 joins (~mav@ip-88-152-10-227.hsi03.unitymediagroup.de)
2020-10-08 13:28:26 solonarv joins (~solonarv@adijon-655-1-70-207.w90-13.abo.wanadoo.fr)
2020-10-08 13:28:27 × jedws quits (~jedws@121.209.161.98) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-08 13:28:46 × martin02 quits (silas@hund.fs.lmu.de) (Quit: WeeChat 2.3)
2020-10-08 13:29:17 <[exa]> troydm: okay, then it should _not_ have any showable representation, a mutable state cannot be exported. Just supply a dummy
2020-10-08 13:29:26 shatriff joins (~vitaliish@88.155.187.71)
2020-10-08 13:29:39 Ariakenom joins (~Ariakenom@193.254.193.1)
2020-10-08 13:30:21 sirfrankiecrisp6 joins (2e8c01af@46.140.1.175)
2020-10-08 13:30:45 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-10-08 13:31:26 × sirfrankiecrisp6 quits (2e8c01af@46.140.1.175) (Remote host closed the connection)
2020-10-08 13:32:03 sirfrankiecrisp joins (~user@46.140.1.175)
2020-10-08 13:32:21 × seanvert quits (~user@177.84.244.242) (Remote host closed the connection)
2020-10-08 13:33:03 × andreas303 quits (~andreas@gateway/tor-sasl/andreas303) (Ping timeout: 240 seconds)
2020-10-08 13:34:04 martin02 joins (silas@hund.fs.lmu.de)
2020-10-08 13:34:32 × knupfer quits (~Thunderbi@200116b82ce4df00300ce483b7c28dd1.dip.versatel-1u1.de) (Quit: knupfer)
2020-10-08 13:34:41 × sirfrankiecrisp quits (~user@46.140.1.175) (Remote host closed the connection)
2020-10-08 13:34:48 knupfer joins (~Thunderbi@200116b82ce4df0089eeab40cb981b9d.dip.versatel-1u1.de)

All times are in UTC.