Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/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. Re: Monad problem (Marcin Mrotek)
2. Re: Monad problem (Imants Cekusins)
3. Re: cabal install snap-server-0.9.5.1: At least the
following dependencies are missing: attoparsec >=0.10 && <0.13 &&
==0.13.0.1 (Stanislaw Findeisen)
4. http-client: Access response body of error responses
(Sevcsik Andr?s)
5. Re: http-client: Access response body of error responses
(Michael Snoyman)
6. Re: http-client: Access response body of error responses
(Sevcsik Andr?s)
----------------------------------------------------------------------
Message: 1
Date: Sun, 12 Jul 2015 15:14:24 +0200
From: Marcin Mrotek <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Monad problem
Message-ID:
<CAJcfPz=g4wakzl+qes1ccxp_axdaw+mbntrd-bhhgua8qoq...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
You're welcome :)
Though I made a mistake in my previous post, if the getUserWhatever
function did IO, i.e. had a type like (MonadBaseControl IO m => m a),
then of course you could also use it in IO directly, but of course
running it with runIdentity would no longer work.
Btw. for the record, instead of something like "MonadBaseControl IO m"
you may see "MonadBase IO m" or just "MonadIO m" (of which MonadBase
is a generalization, to allow other base monads than just IO). All
three type classes have instances for IO, so it doesn't matter at all
if you use it like above (though MonadBaseControl and MonadBase
require MultiParamTypeclasses and FunctionalDependencies extensions,
so they might not work in compilers other than GHC) it only matters
when implementing instances for other monads, as MonadBaseControl
requires one to implement a little more complicated methods.
Best regards,
Marcin Mrotek
------------------------------
Message: 2
Date: Sun, 12 Jul 2015 16:28:33 +0200
From: Imants Cekusins <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Monad problem
Message-ID:
<CAP1qinb2UyPqK29rK+zc=amgcwcq+w7xhfs4emphijzd93f...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
No worries Marcin.
It makes sense.
------------------------------
Message: 3
Date: Sun, 12 Jul 2015 17:40:11 +0200
From: Stanislaw Findeisen <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] cabal install snap-server-0.9.5.1: At
least the following dependencies are missing: attoparsec >=0.10 &&
<0.13 && ==0.13.0.1
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
On 2015-07-10 14:36, Imants Cekusins wrote:
> you could use cabal sandbox.
I went along these lines:
$ cabal update
$ cabal install cabal-install
$ ~/.cabal/bin/cabal sandbox init
$ ~/.cabal/bin/cabal install --only-dependencies --max-backjumps=-1
Then I still had to resolve:
Loading package transformers-0.4.3.0 ... ghc: mmap 1400832 bytes at
(nil): Operation not permitted
ghc: Try specifying an address with +RTS -xm<addr> -RTS
Failed to install vector-0.10.12.3
(and similar) but finally made it work.
Thanks!
--
http://people.eisenbits.com/~stf/
http://www.eisenbits.com/
OpenPGP: 9EC2 5620 2355 B1DC 4A8F 8C79 0EC7 C214 E5AE 3B4E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150712/31564fbe/attachment-0001.sig>
------------------------------
Message: 4
Date: Sun, 12 Jul 2015 18:31:49 +0000
From: Sevcsik Andr?s <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [Haskell-beginners] http-client: Access response body of
error responses
Message-ID:
<cac+tgn6bqm+p+acaaiamp9tnkjekx-f1vgoif3qoqrz9wug...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi list,
Is there any way to read the response body of an >=400 HTTP response with
http-client?
If the response is an error response, it throws a StatusCodeException [1],
which only exposes the headers, not the whole Response value.
However, CouchDB gives a response body for the error responses, describing
the error, which I want to access.
[1]:
https://hackage.haskell.org/package/http-client-0.2.1.1/docs/Network-HTTP-Client.html#v:StatusCodeException
Cheers
--
Minden j?t,
Sevcsik Andr?s
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150712/dcdb8ff1/attachment-0001.html>
------------------------------
Message: 5
Date: Sun, 12 Jul 2015 20:28:24 +0000
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] http-client: Access response body of
error responses
Message-ID:
<CAKA2JgKfzCsS4BUVht3c=plo+hxo+wvhj1sljigohgjsehf...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Look at the docs on the checkStatus field of Request. It allows controlling
whether an exception is thrown.
On Sun, Jul 12, 2015, 11:32 AM Sevcsik Andr?s <[email protected]> wrote:
> Hi list,
>
> Is there any way to read the response body of an >=400 HTTP response with
> http-client?
>
> If the response is an error response, it throws a StatusCodeException [1],
> which only exposes the headers, not the whole Response value.
>
> However, CouchDB gives a response body for the error responses, describing
> the error, which I want to access.
>
> [1]:
> https://hackage.haskell.org/package/http-client-0.2.1.1/docs/Network-HTTP-Client.html#v:StatusCodeException
>
> Cheers
> --
> Minden j?t,
> Sevcsik Andr?s
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150712/a9d23ffa/attachment-0001.html>
------------------------------
Message: 6
Date: Sun, 12 Jul 2015 23:37:19 +0000
From: Sevcsik Andr?s <[email protected]>
To: Michael Snoyman <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: [Haskell-beginners] http-client: Access response body of
error responses
Message-ID:
<CAC+TGN47jb=e45pw1n3l_m-_0scdtjnzh8jvb7v7z_1ytg5...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Great, that did the trick. Thank you!
On Sun, Jul 12, 2015 at 10:28 PM Michael Snoyman <[email protected]>
wrote:
> Look at the docs on the checkStatus field of Request. It allows
> controlling whether an exception is thrown.
>
> On Sun, Jul 12, 2015, 11:32 AM Sevcsik Andr?s <[email protected]> wrote:
>
>> Hi list,
>>
>> Is there any way to read the response body of an >=400 HTTP response with
>> http-client?
>>
>> If the response is an error response, it throws a StatusCodeException
>> [1], which only exposes the headers, not the whole Response value.
>>
>> However, CouchDB gives a response body for the error responses,
>> describing the error, which I want to access.
>>
>> [1]:
>> https://hackage.haskell.org/package/http-client-0.2.1.1/docs/Network-HTTP-Client.html#v:StatusCodeException
>>
>> Cheers
>> --
>> Minden j?t,
>> Sevcsik Andr?s
>>
> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
--
Minden j?t,
Sevcsik Andr?s
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150712/b95b74cf/attachment-0001.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 85, Issue 9
****************************************