how to do IO in an event handler?

45 views
Skip to first unread message

cohomology

unread,
Jan 26, 2017, 11:45:21 AM1/26/17
to Brick Users
How do you do some IO in an event handler, e.g., connect to a DB, read from/write to a remote host?

Does anyone have a minimal example? Thanks!

Jonathan Daugherty

unread,
Jan 26, 2017, 11:50:32 AM1/26/17
to cohomology, Brick Users
Hi,

The EventM monad instances MonadIO, so you can do I/O with "liftIO".

On Jan 26, 2017, at 8:45 AM, cohomology <buyn...@gmail.com> wrote:

How do you do some IO in an event handler, e.g., connect to a DB, read from/write to a remote host?

Does anyone have a minimal example? Thanks!

--
You received this message because you are subscribed to the Google Groups "Brick Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brick-users...@googlegroups.com.
To post to this group, send email to brick...@googlegroups.com.
Visit this group at https://groups.google.com/group/brick-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/brick-users/790c4933-c932-41ed-bf0d-0f7640dd0ec1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cohomology

unread,
Jan 26, 2017, 2:21:09 PM1/26/17
to Brick Users
Thanks! Just read that in the user guide.

Thank you for making this very handy library!

Jonathan Daugherty

unread,
Jan 26, 2017, 2:21:58 PM1/26/17
to cohomology, Brick Users
Reply all
Reply to author
Forward
0 new messages