pplorins 2017-01-27 15:58:15
hello everyone
lambdabot 2017-01-27 15:58:28
Hello.
geekosaur 2017-01-27 16:01:25
fwiw that earlier thing was likely @@ / ?? (echo text expanding @/? commands embedded in it)
lolisa 2017-01-27 16:02:01
Hello.
saltz 2017-01-27 16:10:16
I'm trying to install hsdev via stack for sublime haskell. I get " haskell-src-exts-1.17.1 must match >=1.18.0 && <1.19.0 (latest applicable is 1.18.2)" and a similar error for simple-log. I've tried requiring higher versions in global stack.yaml but I guess other packages require that version. what am I missing?
geekosaur 2017-01-27 16:11:46
check what resolver you're using?
saltz 2017-01-27 16:12:48
lts-7.16
geekosaur 2017-01-27 16:14:53
yep. probably need a nightly, or a local stack.yaml with the newer versions as extra-deps
saltz 2017-01-27 16:15:18
got it, thanks
geekosaur 2017-01-27 16:15:21
nightly indeed has haskell-src-exts-1.18.2
saltz 2017-01-27 16:15:38
I see -- now I know what to look for next time. thank you.
MarcelineVQ 2017-01-27 16:21:18
is this a good way to create an arbitrary number of IO actions with a limited number working at a time? http://lpaste.net/351728 Can you think of a better one?
MarcelineVQ 2017-01-27 16:21:39
*concurrent IO actions
monochrom 2017-01-27 16:22:30
Does writeTBQueue block when the queue is full, waiting for an empty slot?
MarcelineVQ 2017-01-27 16:23:03
yes
monochrom 2017-01-27 16:24:59
Yes this is a good way.
monochrom 2017-01-27 16:25:51
There are two other good ways, one is dual to yours, and one is dual to both. But no significant advantage.
edwardk 2017-01-27 16:26:00
lolisa: (Cofree f) is the comonad in question, (Free f) is the monad
MarcelineVQ 2017-01-27 16:26:16
That's good news, it was a bumpy road to this solution but worthwhile
edwardk 2017-01-27 16:26:46
er Cofree w and Free m
edwardk 2017-01-27 16:26:56
Cofree w is a comonad whenever w is a functor
edwardk 2017-01-27 16:27:02
Free m is a monad whenever m is a functor
monochrom 2017-01-27 16:27:18
The dual to yours is initially put 5 ()'s into a queue. Then withPool dequeues, runs job, enqueues. Think of each () as a license to run. In this case you don't need a bounded queue, any queue will do.
glguy 2017-01-27 16:28:11
QSem bundles that behavior up
monochrom 2017-01-27 16:28:31
The dual to both is you don't queue ()'s. You queue jobs. Then have 5 threads, each thread snatches a job from the queue, do it, repeat. (aka processor farm, aka thread pool.)
edwardk 2017-01-27 16:28:41
fwiw the chronomorphism thing turns out to be fairly boring
edwardk 2017-01-27 16:29:17
g_hylo and knowing about how to build distributive laws or the more interesting style of adjoint folds is where its at.
edwardk 2017-01-27 16:29:51
all the other whatevermorphisms are variants on cata/ana/hylo just mangled by using a distributive law in a stylized manner.
edwardk 2017-01-27 16:31:39
g_chrono uses the ability to promote a distributive law of f over w into one of f over (Cofree w) and one of m over f into one of (Free m) over f, then its just a generalized hylomorphism
MarcelineVQ 2017-01-27 16:33:06
monochrom, glguy: thank you, concurrency is new stuff for me. I was going to look at semaphores next since they were mentioned in simon's book and relate to the problem I want to solve but had no idea base already had them