Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Control.Exception.bracket-like for MonadIO ? (Olivier Iffrig)
2. Re: Control.Exception.bracket-like for MonadIO ?
(Michael Snoyman)
----------------------------------------------------------------------
Message: 1
Date: Thu, 10 Oct 2013 10:53:19 +0200
From: Olivier Iffrig <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Control.Exception.bracket-like for
MonadIO ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Hello,
I'm trying to build an application with a monad encapsulating its state,
environment, ...
For the sake of simplicity, let's say
data MyState
type Main = StateT MyState IO
But I would like to use something like bracket with my Main monad, and I
did not find how to to it.
I'm looking for something like
bracket' :: MonadIO m => m a -> (a -> m b) -> (a -> m c) -> m c
or in my case
myBracket :: Main a -> (a -> Main b) -> (a -> Main c) -> Main c
Searching for that on hoogle did not give me anything interesting...
Did someone encounter this problem, and have a solution ?
--
Olivier
------------------------------
Message: 2
Date: Thu, 10 Oct 2013 11:03:06 +0200
From: Michael Snoyman <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Control.Exception.bracket-like for
MonadIO ?
Message-ID:
<CAKA2JgLbJPJFg6gNXs8fsQ==4fsbais7syuv0kf7bbrmhoh...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
I'd recommend checking out Control.Exception.Lifted from lifted-base:
http://haddocks.fpcomplete.com/fp/7.4.2/20130922-179/lifted-base/Control-Exception-Lifted.html
On Thu, Oct 10, 2013 at 11:53 AM, Olivier Iffrig <[email protected]> wrote:
> Hello,
>
> I'm trying to build an application with a monad encapsulating its state,
> environment, ...
> For the sake of simplicity, let's say
>
> data MyState
> type Main = StateT MyState IO
>
> But I would like to use something like bracket with my Main monad, and I
> did not find how to to it.
>
> I'm looking for something like
> bracket' :: MonadIO m => m a -> (a -> m b) -> (a -> m c) -> m c
>
> or in my case
> myBracket :: Main a -> (a -> Main b) -> (a -> Main c) -> Main c
>
> Searching for that on hoogle did not give me anything interesting...
> Did someone encounter this problem, and have a solution ?
>
> --
> Olivier
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20131010/e719648d/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 64, Issue 17
*****************************************