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. Re: confused by <- (David McBride)
2. Re: confused by <- (David McBride)
3. Re: confused by <- (Brent Yorgey)
4. Re: confused by <- (Chadda? Fouch?)
5. Re: FRP (Nathan H?sken)
----------------------------------------------------------------------
Message: 1
Date: Thu, 27 Sep 2012 13:43:52 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] confused by <-
To: Brent Yorgey <[email protected]>
Cc: [email protected]
Message-ID:
<can+tr42o0n7z9yrqzj_wlyrfn96fqxstmc6ti1labjgimhm...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
I think what he is asking is if try (from lifted) has type
try ::
(MonadBaseControl<http://hackage.haskell.org/packages/archive/monad-control/0.3.1.4/doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl>
IO<http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/System-IO.html#t:IO>m,
Exception<http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Control-Exception-Base.html#t:Exception>e)
=> m a -> m (
Either<http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Data-Either.html#t:Either>e
a)
and simpleHttp is
simpleHttp "googe" ::
IO<http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/System-IO.html#t:IO>(
Result<http://hackage.haskell.org/packages/archive/HTTP/latest/doc/html/Network-Stream.html#t:Result>(
Response<http://hackage.haskell.org/packages/archive/HTTP/latest/doc/html/Network-HTTP-Base.html#t:Response>ty))
then how can the whole statement have
try $ simpleHttp "goog" :: GHandler master sub (Either SomeException
ByteString)
when the m in both parts of try is the same, it should end up IO not
GHandler master sub. So I don't understand why this would work, either.
On Thu, Sep 27, 2012 at 1:33 PM, Brent Yorgey <[email protected]>wrote:
> On Thu, Sep 27, 2012 at 10:01:25AM -0700, Bryce Verdier wrote:
> > On 9/26/12 6:00 PM, Ertugrul S?ylemez wrote:
> > >Bryce Verdier <[email protected]> wrote:
> > >
> > >> body <- L.try (simpleHttp "http://www.google.com") :: IO (Either
> > >>L.SomeException Data.ByteString.Lazy.Internal.ByteString)
> > >Almost right, but your type signature is lying. =)
> > >
> > >
> > >Greets,
> > >Ertugrul
> >
> > Thanks for your hint, with a fair amount of head bashing against a
> > wall I was able to figure this out. At the end of day I got :
> >
> > body <- try (simpleHttp "http://www.google.com") :: GHandler
> > PlayHaven PlayHaven (Either SomeException ByteString)
>
> Do you need a type signature there at all?
>
> -Brent
>
> _______________________________________________
> 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/20120927/9863ef11/attachment-0001.htm>
------------------------------
Message: 2
Date: Thu, 27 Sep 2012 13:45:38 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] confused by <-
To: Brent Yorgey <[email protected]>
Cc: [email protected]
Message-ID:
<can+tr4101jas3vxkovrg3xossqdtycjps5xsckcpfhn8z9k...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Ignore my message. I think I'm looking at the wrong version of simpleHttp
or something. I should have tried it in ghci before I posted.
On Thu, Sep 27, 2012 at 1:43 PM, David McBride <[email protected]> wrote:
> I think what he is asking is if try (from lifted) has type
>
> try ::
> (MonadBaseControl<http://hackage.haskell.org/packages/archive/monad-control/0.3.1.4/doc/html/Control-Monad-Trans-Control.html#t:MonadBaseControl>
> IO<http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/System-IO.html#t:IO>m,
> Exception<http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Control-Exception-Base.html#t:Exception>e)
> => m a -> m (
> Either<http://hackage.haskell.org/packages/archive/base/4.5.0.0/doc/html/Data-Either.html#t:Either>e
> a)
>
> and simpleHttp is
>
> simpleHttp "googe" ::
> IO<http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/System-IO.html#t:IO>(
> Result<http://hackage.haskell.org/packages/archive/HTTP/latest/doc/html/Network-Stream.html#t:Result>(
> Response<http://hackage.haskell.org/packages/archive/HTTP/latest/doc/html/Network-HTTP-Base.html#t:Response>ty))
>
> then how can the whole statement have
>
> try $ simpleHttp "goog" :: GHandler master sub (Either SomeException
> ByteString)
>
> when the m in both parts of try is the same, it should end up IO not
> GHandler master sub. So I don't understand why this would work, either.
>
>
> On Thu, Sep 27, 2012 at 1:33 PM, Brent Yorgey <[email protected]>wrote:
>
>> On Thu, Sep 27, 2012 at 10:01:25AM -0700, Bryce Verdier wrote:
>> > On 9/26/12 6:00 PM, Ertugrul S?ylemez wrote:
>> > >Bryce Verdier <[email protected]> wrote:
>> > >
>> > >> body <- L.try (simpleHttp "http://www.google.com") :: IO
>> (Either
>> > >>L.SomeException Data.ByteString.Lazy.Internal.ByteString)
>> > >Almost right, but your type signature is lying. =)
>> > >
>> > >
>> > >Greets,
>> > >Ertugrul
>> >
>> > Thanks for your hint, with a fair amount of head bashing against a
>> > wall I was able to figure this out. At the end of day I got :
>> >
>> > body <- try (simpleHttp "http://www.google.com") :: GHandler
>> > PlayHaven PlayHaven (Either SomeException ByteString)
>>
>> Do you need a type signature there at all?
>>
>> -Brent
>>
>> _______________________________________________
>> 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/20120927/2eef9b0c/attachment-0001.htm>
------------------------------
Message: 3
Date: Thu, 27 Sep 2012 13:48:18 -0400
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] confused by <-
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-1
On Thu, Sep 27, 2012 at 10:38:31AM -0700, Bryce Verdier wrote:
> On 9/27/12 10:33 AM, Brent Yorgey wrote:
> >On Thu, Sep 27, 2012 at 10:01:25AM -0700, Bryce Verdier wrote:
> >>On 9/26/12 6:00 PM, Ertugrul S?ylemez wrote:
> >>>Bryce Verdier <[email protected]> wrote:
> >>>
> >>>> body <- L.try (simpleHttp "http://www.google.com") :: IO (Either
> >>>>L.SomeException Data.ByteString.Lazy.Internal.ByteString)
> >>>Almost right, but your type signature is lying. =)
> >>>
> >>>
> >>>Greets,
> >>>Ertugrul
> >>Thanks for your hint, with a fair amount of head bashing against a
> >>wall I was able to figure this out. At the end of day I got :
> >>
> >> body <- try (simpleHttp "http://www.google.com") :: GHandler
> >>PlayHaven PlayHaven (Either SomeException ByteString)
> >Do you need a type signature there at all?
> >
> >-Brent
> That is an awesome question. Originally I tried:
>
> body <- try (simpleHttp "http://www.google.com")
>
> and I got this error:
> playhaven.hs:54:73:
> Ambiguous type variable `a0' in the constraints:
> (Show a0) arising from a use of `show' at playhaven.hs:54:73-76
> (Exception a0) arising from a use of `try' at playhaven.hs:52:13-15
> Probable fix: add a type signature that fixes these type variable(s)
>
> So I figured that adding the type signature would help with it. If
> you know of another way to make this work I would really like to hear
> about it.
Ah, yes, then you do need a type signature.
(Sadly I cannot answer your real question, since I don't know anything
about the libraries in question.)
-Brent
------------------------------
Message: 4
Date: Thu, 27 Sep 2012 21:25:12 +0200
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] confused by <-
To: Bryce Verdier <[email protected]>
Cc: [email protected]
Message-ID:
<canfjzrzsnmk4v1sinngngg0rqh9jwzq-f_cfpc+zbz3rij0...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Thu, Sep 27, 2012 at 7:38 PM, Bryce Verdier <[email protected]>wrote:
> On 9/27/12 10:33 AM, Brent Yorgey wrote:
>
>> On Thu, Sep 27, 2012 at 10:01:25AM -0700, Bryce Verdier wrote:
>>
>>> On 9/26/12 6:00 PM, Ertugrul S?ylemez wrote:
>>>
>>>> Bryce Verdier <[email protected]> wrote:
>>>>
>>>> body <- L.try (simpleHttp "http://www.google.com") :: IO (Either
>>>>> L.SomeException Data.ByteString.Lazy.Internal.**ByteString)
>>>>>
>>>> Almost right, but your type signature is lying. =)
>>>>
>>>>
>>>> Greets,
>>>> Ertugrul
>>>>
>>> Thanks for your hint, with a fair amount of head bashing against a
>>> wall I was able to figure this out. At the end of day I got :
>>>
>>> body <- try (simpleHttp "http://www.google.com") :: GHandler
>>> PlayHaven PlayHaven (Either SomeException ByteString)
>>>
>> Do you need a type signature there at all?
>>
>> -Brent
>>
> That is an awesome question. Originally I tried:
>
>
> body <- try (simpleHttp "http://www.google.com")
>
this can be made to work by adding less stuff :
> getGoogR = do
> body <- try (simpleHttp "http://www.google.com")
> case body of
> Left (SomeException _) -> jsonToRepJson $ object ["response" .= (
show "ERROR: NO DATA FOR ONE REASON OR ANOTHER")]
> Right val -> jsonToRepJson $ object ["response" .= (showDigest $
sha1 val)]
I think that should work...
--
Jeda?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120927/ae2ee7b1/attachment-0001.htm>
------------------------------
Message: 5
Date: Thu, 27 Sep 2012 21:40:27 +0200
From: Nathan H?sken <[email protected]>
Subject: Re: [Haskell-beginners] FRP
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On 09/16/2012 09:16 AM, Ertugrul S?ylemez wrote:
> Christopher Howard <[email protected]> wrote:
> Let me take Netwire 4 as an example. It's not on
> Hackage yet, so you may want to grab it using darcs:
>
> darcs get http://darcs.ertes.de/netwire/
>
I must admit netwire 4 catched my interest. Would you consider it ready
enough to try it or will I (beeing still more or less a haskell novice)
despair of it?
Regards,
Nathan
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 51, Issue 41
*****************************************