marekw2143 2017-02-18 01:46:09
hmm, I'm writing chess engine
marekw2143 2017-02-18 01:46:18
and GUI app uses my code
marekw2143 2017-02-18 01:46:26
and I'm not sure that gui uses line buffered IO
c_wraith 2017-02-18 01:46:49
you can set stdout to non-buffered
marekw2143 2017-02-18 01:47:12
how ?
c_wraith 2017-02-18 01:47:35
whatever function sets buffering mode on a handle. I think it's in System.IO
c_wraith 2017-02-18 01:48:33
Yeah. System.IO has everything that you need for that.
marekw2143 2017-02-18 01:48:48
ok, I'll look for it
marekw2143 2017-02-18 01:55:19
c_wraith, thanks, it works
marekw2143 2017-02-18 01:55:28
I just didn't think that it's such important
c_wraith 2017-02-18 01:55:33
you're welcome
c_wraith 2017-02-18 01:56:18
yeah, IO buffering is one of those things that isn't important at all, until everything breaks when it suddenly is important. :)
marekw2143 2017-02-18 02:02:01
;)
marekw2143 2017-02-18 02:02:15
I just have a question about monad transformers
marekw2143 2017-02-18 02:02:29
their purpose is just to be able to execute one monad in context of another ?
Kuros 2017-02-18 02:03:09
or making a frankenstein's monad
c_wraith 2017-02-18 02:03:16
I'd describe their purpose as being able to combine the effects of different monads
athan 2017-02-18 02:03:27
marekw2143: Yeah kinda, or extending a monad with the properties of another
athan 2017-02-18 02:03:41
where the monad being extended is the "base" monad
marekw2143 2017-02-18 02:03:58
ok, but when there's for example MaybeList omnad
marekw2143 2017-02-18 02:04:12
then List behaviour (that is applying function to each element of the list)
marekw2143 2017-02-18 02:04:18
is not handled by MaybeList
marekw2143 2017-02-18 02:04:21
am I right ?
athan 2017-02-18 02:04:32
MaybeList a = MaybeT (ListT Identity) a
athan 2017-02-18 02:05:06
idk :)
athan 2017-02-18 02:05:28
usually you see the tuple monad and function monad combined
athan 2017-02-18 02:05:39
as StateT / ReaderT (kinda)
marekw2143 2017-02-18 02:08:54
usually yes
marekw2143 2017-02-18 02:09:12
but list monad is different to other ,that is executes another function many times
marekw2143 2017-02-18 02:09:35
and that example maybe is not best for learning monad transformers from scratch
marekw2143 2017-02-18 02:09:37
;)
marekw2143 2017-02-18 02:09:49
but I'm a haskell beginner as you can see ;)
athan 2017-02-18 02:10:06
s_s
cocreature 2017-02-18 02:11:33
marekw2143: list is very rarely used in monad transformer stacks. it's probably easier to start with something like MaybeT IO if you want to figure out how to use them and why they can be useful
piyush-kurur 2017-02-18 02:20:59
does any one know a function with the types (i -> Source m o) -> Conduit i m o
piyush-kurur 2017-02-18 02:21:31
The intuition is similar to concatMap. I do not seem to find it
lyxia 2017-02-18 02:28:12
piyush-kurur: awaitForever
lyxia 2017-02-18 02:28:38
After composing the continuation with toProducer
piyush-kurur 2017-02-18 02:34:02
lyxia: sorry what do you mean by after composing the continuation with toProducer?
piyush-kurur 2017-02-18 02:34:43
awaitForever just has an extra i in it, i.e. it is (i -> Conduit i m o)
piyush-kurur 2017-02-18 02:35:59
Okey sorry I think I got it. Let me try
lyxia 2017-02-18 02:36:17
:)
piyush-kurur 2017-02-18 02:37:09
lyxia: yeah worked for me
piyush-kurur 2017-02-18 02:37:18
but that was non-trivial
lyxia 2017-02-18 02:37:22
right
piyush-kurur 2017-02-18 02:37:26
lyxia: thanks
lyxia 2017-02-18 02:37:43
you'll get used to it!
piyush-kurur 2017-02-18 02:38:03
I was banging my head on how to get rid of the i.
piyush-kurur 2017-02-18 02:38:07
for quite some time