megaTherion 2017-02-20 11:47:49
merijn: :(
megaTherion 2017-02-20 11:48:13
merijn: dont worry, I'll google around
merijn 2017-02-20 11:48:24
google for like "ghci custom print" or something
dmwit 2017-02-20 11:49:26
megaTherion: What kind of coloring do you want?
megaTherion 2017-02-20 11:49:46
syntax hilighting, like for the things you write in ghci and also for type informations and stuff
megaTherion 2017-02-20 11:50:04
no color at all just seems to be a little unsatisfying
megaTherion 2017-02-20 11:50:25
Im checking this right now: https://wiki.haskell.org/GHCi_in_colour
dmwit 2017-02-20 11:50:27
You might like iHaskell.
merijn 2017-02-20 11:50:31
megaTherion: syntax highlighting for like writing?
ludat 2017-02-20 11:51:10
after working in rust I really miss colors in my compiler output
MarcelineVQ 2017-02-20 11:52:16
next major ghc release has error colors :>
megaTherion 2017-02-20 11:52:22
dmwit: iHaskell?
dmwit 2017-02-20 11:52:51
https://camo.githubusercontent.com/8e92d2d571f80b17019e8e477cc29015cf57a4bd/68747470733a2f2f7261772e6769746875622e636f6d2f67696269616e736b792f494861736b656c6c2f6d61737465722f696d616765732f696861736b656c6c2d6e6f7465626f6f6b2e706e67
dmwit 2017-02-20 11:52:55
oh dear
dmwit 2017-02-20 11:53:07
That URL ended up being longish. Sorry about that.
dmwit 2017-02-20 11:53:10
https://github.com/gibiansky/IHaskell
glguy 2017-02-20 11:53:16
mzabani: makeConnection takes arguments with types "IO ByteString" and "ByteString -> IO ()". It's unlikely that you'd want to make a MonadState instance for those types
ludat 2017-02-20 11:53:48
MarcelineVQ, which one? 8.2? that would be so awesome
dmwit 2017-02-20 11:54:04
mzabani: You could consider storing your state in an `IORef`.
MarcelineVQ 2017-02-20 11:55:37
ludat: yeah, it's in head already so I'd expect a presence in 8.2
ludat 2017-02-20 11:57:15
:hardcore_party_parrot:
ludat 2017-02-20 11:57:48
now I have more incentive to get snap into the latest stackage
MarcelineVQ 2017-02-20 11:58:45
it's probbaly not as spectacular as you're imagining :>
ludat 2017-02-20 11:59:21
I really like colors on my cli things
mzabani 2017-02-20 12:01:54
dmwit: I thought of something like that.. is this the only way you see to make this happen?
mzabani 2017-02-20 12:01:54
glguy: I'm not sure I understand you correctly (I'm new to all this, sorry), but I'm not trying to make IO an instance of MonadState
mzabani 2017-02-20 12:02:24
what I'm trying to do is have http-client send and receive from a websockets tunnel, whose functions live in a custom monad (which is basically a MonadState).
glguy 2017-02-20 12:03:00
makeConnection isn't interested in any custom types. You'll have to provide things with the specific types being requested of IO ByteString and ByteString -> IO ()
glguy 2017-02-20 12:05:12
You could perhaps define something with type: MVar SomeState -> StateT SomeState IO ByteString -> IO ByteString and use that to adapt your MonadState constrained definition
glguy 2017-02-20 12:05:34
MVar SomeState -> StateT SomeState IO a -> IO a *
MarcelineVQ 2017-02-20 12:09:14
ludat: afaik this is about the sum of it currently https://phabricator.haskell.org/D2716
mzabani 2017-02-20 12:11:18
glguy: if the tunnel is to be used by something other than http-client, shouldn't I make its implementation rely only on (MVar SomeState)? Any modifications to the State done by http-client should be accessible to others in the same tunnel..
glguy 2017-02-20 12:12:38
mzabani: That's why you'd need to put the final state back into the MVar at the end
mzabani 2017-02-20 12:16:27
glguy: could I just get rid of StateT entirely and do this inside my own Monad implementation (let's say MonadTunnel), always depending on (MVar SomeState)?
glguy 2017-02-20 12:18:59
Whether or not you make a new typeclass (is that what MonadTunnel was going to be?) isn't important. The main thing is that at the end what you've built has the type expected by makeConnection
mzabani 2017-02-20 12:20:08
all right, I think I've got a lot of info on how to get on with this. Thank you very much for your help!