Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 529 530 531 532 533 534 535 536 537 538 539 .. 5022
502,152 events total
2020-10-09 09:11:18 <xwvvvvwx> Does anyone have any tips?
2020-10-09 09:12:45 <Taneb> xwvvvvwx: can you use the arbitrary instance for Set? I think that would work if you only need a small number of names
2020-10-09 09:13:25 polyrain joins (~polyrain@2001:8003:e501:6901:c889:b4c6:945c:a1ea)
2020-10-09 09:13:47 × snakemas1 quits (~snakemast@213.100.206.23) (Ping timeout: 240 seconds)
2020-10-09 09:13:47 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Ping timeout: 260 seconds)
2020-10-09 09:13:55 × bliminse quits (~bliminse@host217-42-95-37.range217-42.btcentralplus.com) (Quit: leaving)
2020-10-09 09:14:16 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
2020-10-09 09:14:27 × thir quits (~thir@p200300f27f02580060eb7dde324e54c8.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2020-10-09 09:14:54 bliminse joins (~bliminse@host217-42-95-37.range217-42.btcentralplus.com)
2020-10-09 09:15:01 <xwvvvvwx> ohhhhhh clever
2020-10-09 09:15:09 snakemas1 joins (~snakemast@213.100.206.23)
2020-10-09 09:15:27 <xwvvvvwx> and then pull a random element from the set?
2020-10-09 09:16:39 × todda7 quits (~torstein@2a02:587:d2d:4f00:1158:6d78:eb7d:9777) (Ping timeout: 272 seconds)
2020-10-09 09:18:17 <xwvvvvwx> or no if I pull a random elemnent I might repeat myself
2020-10-09 09:18:25 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Ping timeout: 240 seconds)
2020-10-09 09:18:27 hackage openapi3 3.0.0.1 - OpenAPI 3.0 data model https://hackage.haskell.org/package/openapi3-3.0.0.1 (maksbotan)
2020-10-09 09:18:37 <xwvvvvwx> I need to have some counter to make sure I never pull the same element
2020-10-09 09:18:42 <phadej> you cannot have "unique randoms" without carrying some state with you
2020-10-09 09:19:01 × berberman quits (~berberman@2408:8207:2569:5270:584e:a9ff:fe9b:d3fe) (Quit: ZNC 1.7.5 - https://znc.in)
2020-10-09 09:19:32 <dminuoso> xwvvvvwx: Just a hunch.. but you are not looking for `unbound`, are you? :>
2020-10-09 09:20:16 <xwvvvvwx> https://hackage.haskell.org/package/unbound ?
2020-10-09 09:20:19 <dminuoso> Yes.
2020-10-09 09:20:33 <dminuoso> Oh wait, I missed the QuickCheck part. Nevermind me.
2020-10-09 09:20:43 berberman joins (~berberman@2408:8207:2569:5270:584e:a9ff:fe9b:d3fe)
2020-10-09 09:20:57 hackage servant-openapi3 2.0.0.1 - Generate a Swagger/OpenAPI/OAS 3.0 specification for your servant API. https://hackage.haskell.org/package/servant-openapi3-2.0.0.1 (maksbotan)
2020-10-09 09:20:59 tw1sted1 joins (~tw1sted@184.75.221.3)
2020-10-09 09:21:53 × berberman quits (~berberman@2408:8207:2569:5270:584e:a9ff:fe9b:d3fe) (Client Quit)
2020-10-09 09:22:01 ubert joins (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233)
2020-10-09 09:22:17 <xwvvvvwx> Can I do something with the state monad?
2020-10-09 09:22:41 berberman joins (~berberman@2408:8207:2569:5270:584e:a9ff:fe9b:d3fe)
2020-10-09 09:24:20 × jedws quits (~jedws@121.209.161.98) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-09 09:24:25 __monty__ joins (~toonn@unaffiliated/toonn)
2020-10-09 09:24:57 ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net)
2020-10-09 09:26:13 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
2020-10-09 09:26:45 × berberman quits (~berberman@2408:8207:2569:5270:584e:a9ff:fe9b:d3fe) (Client Quit)
2020-10-09 09:27:00 berberman joins (~berberman@123.118.111.247)
2020-10-09 09:27:51 <phadej> you can work with StateT something Gen yes
2020-10-09 09:30:11 <phadej> But i'd rather rethink whether you really need unique random names
2020-10-09 09:30:14 <phadej> to begin with
2020-10-09 09:30:30 <carbolymer> I need to block thread indefinitely - `newEmptyMVar >>= takeMVar` - is it a good idea?
2020-10-09 09:30:44 <phadej> that's something (uniqueness) which is hard to maintain in shrinking
2020-10-09 09:31:22 <phadej> carbolymer: that might not work, as you might get a "BlockedIndefinitelyOnMVar" exception
2020-10-09 09:31:43 <phadej> why you want to block indefinitely, that doesn't sound right
2020-10-09 09:31:57 <phadej> surely there' something you can wait on
2020-10-09 09:32:24 <carbolymer> phadej, we have weird app shutdown process implemented - all services are getting `cancel`-ed (from async)
2020-10-09 09:32:36 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Ping timeout: 272 seconds)
2020-10-09 09:32:43 <carbolymer> phadej, so my idea is to catch AsyncCancelled and perform resources cleanup
2020-10-09 09:33:24 <phadej> they [async'd threads] will do cleanup if you use `bracket`?
2020-10-09 09:33:31 <phadej> ... to acquire them
2020-10-09 09:33:34 <phadej> no need to catch anything
2020-10-09 09:33:45 <carbolymer> phadej, I can't use bracket, because the cleanup has to be done a completely different place
2020-10-09 09:34:03 kl1xto joins (~klixto@49.188.65.219)
2020-10-09 09:34:14 <carbolymer> our app design is flawed :/
2020-10-09 09:34:38 × kl1xto quits (~klixto@49.188.65.219) (Client Quit)
2020-10-09 09:34:45 <carbolymer> phadej, so my idea is to `(newEmptyMVar >>= takeMVar) `catch` (\(_ :: AsyncCancelled) -> doCleanup)`
2020-10-09 09:34:46 <phadej> anyway, you can have "this thread is completed" TVar for each thread, and wait until they become `True`
2020-10-09 09:35:08 <dminuoso> carbolymer: How about, instead of throwing an async exception, you use an MVar?
2020-10-09 09:35:21 <dminuoso> That way you can just take from an initially empty MVar, and if the other side wants to terminate, they just put to it?
2020-10-09 09:35:26 <[exa]> async exception?!
2020-10-09 09:35:39 <phadej> yes, what dminuoso proposes is better.
2020-10-09 09:35:42 DavidEichmann joins (~david@43.240.198.146.dyn.plus.net)
2020-10-09 09:35:45 <phadej> make something to wait upon, and wait on it.
2020-10-09 09:36:17 <phadej> flawed current state is not a good reason to make it even worse :)
2020-10-09 09:36:28 <carbolymer> dminuoso, that would work I guess, it would be a precedent though
2020-10-09 09:36:49 <phadej> feels like there is no clear resource ownership
2020-10-09 09:37:00 <carbolymer> yeah...
2020-10-09 09:37:53 <[exa]> carbolymer: do the services somehow process "requests" or "data packages" or anything?
2020-10-09 09:38:47 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
2020-10-09 09:39:09 <carbolymer> [exa], yes
2020-10-09 09:40:07 <[exa]> the usual way is to either have a special request that says "all done, pls exit", or even better a shared exit flag (simple wrapped IORef will do) that the tiny services check regularly
2020-10-09 09:43:21 <carbolymer> [exa], I agree, it's aka poison pill, If I were implmeenting the app from scratch, I would implement it that way, it's just it was done previously by canceling services
2020-10-09 09:43:47 <carbolymer> and I wanted to fit in, without week-long refactoring ;)
2020-10-09 09:43:57 hackage hasql-dynamic-statements 0.2.0.3 - Toolkit for constructing Hasql statements dynamically https://hackage.haskell.org/package/hasql-dynamic-statements-0.2.0.3 (NikitaVolkov)
2020-10-09 09:44:43 <phadej> Haskell is the language to do refactorings
2020-10-09 09:45:21 <phadej> very enjoyable if you are sure what's the end state should be, IMO.
2020-10-09 09:45:25 <phadej> would rather do sooner than later.
2020-10-09 09:45:32 <carbolymer> but when you can deliver business values, when all you do is refactoring? :)
2020-10-09 09:45:44 <phadej> on mondays.
2020-10-09 09:45:50 <carbolymer> on meetings ;-]
2020-10-09 09:45:53 × ahmr88 quits (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) (Remote host closed the connection)
2020-10-09 09:46:39 × polyrain quits (~polyrain@2001:8003:e501:6901:c889:b4c6:945c:a1ea) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-09 09:47:10 × berberman quits (~berberman@123.118.111.247) (Quit: ZNC 1.7.5 - https://znc.in)
2020-10-09 09:47:31 berberman joins (~berberman@123.118.111.247)
2020-10-09 09:47:38 × berberman quits (~berberman@123.118.111.247) (Remote host closed the connection)
2020-10-09 09:47:42 m0rphism joins (~m0rphism@HSI-KBW-046-005-177-122.hsi8.kabel-badenwuerttemberg.de)
2020-10-09 09:48:26 berberman joins (~berberman@2408:8207:2569:5270:584e:a9ff:fe9b:d3fe)
2020-10-09 09:50:46 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Remote host closed the connection)
2020-10-09 09:50:56 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
2020-10-09 09:52:14 × tw1sted1 quits (~tw1sted@184.75.221.3) (Ping timeout: 272 seconds)
2020-10-09 09:53:19 jedws joins (~jedws@121.209.161.98)
2020-10-09 09:57:12 <AWizzArd> Guys, what is your general strategy in Snap to „extract” request parameters? We may have route [ ("populate/:collection/:precision", populateHandler) ] and expect two variables, say an Int and String. I can call `getParam "collection"` to get a Maybe value. Same for precision. Only when both are available I want to handle the request, otherwise throw a client error.
2020-10-09 09:57:20 <AWizzArd> Then I will also have to parse the incoming data and see if it is plausible. This may result in more Maybes or Eithers. This whole machinery needs to be repeated in every single handler.
2020-10-09 09:57:26 <AWizzArd> Does Snap offer anything that allows me to do the core extraction, getting rid of Maybes/Eithers and such?
2020-10-09 10:00:55 galagora joins (c5ed143c@197.237.20.60)
2020-10-09 10:00:58 hackage mmsyn7s 0.9.1.0 - Shows a sorted list of the Ukrainian sounds representations that can be used by mmsyn7 series of programs https://hackage.haskell.org/package/mmsyn7s-0.9.1.0 (OleksandrZhabenko)
2020-10-09 10:02:51 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-09 10:04:07 × snyp quits (~rksht@49.207.204.102) (Ping timeout: 240 seconds)
2020-10-09 10:04:46 cr0ssw1nd joins (~crosswind@adsl-174.176.58.193.tellas.gr)
2020-10-09 10:05:01 <cr0ssw1nd> hi folks
2020-10-09 10:05:12 × jedws quits (~jedws@121.209.161.98) (Quit: My MacBook has gone to sleep. ZZZzzz…)

All times are in UTC.