Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  What's this [f| data |]  ?? (Carlos J. G. Duarte)
   2. Re:  What's this [f| data |]  ?? (Jack Henahan)
   3. Re:  What's this [f| data |] ?? (David McBride)
   4. Re:  What's this [f| data |]  ?? (Brent Yorgey)
   5. Re:  What's this [f| data |] ?? (Felipe Almeida Lessa)
   6. Re:  What's this [f| data |] ?? (Felipe Almeida Lessa)
   7. Re:  Using tls-extra for simple smtp (Henk-Jan van Tuyl)


----------------------------------------------------------------------

Message: 1
Date: Wed, 04 Jul 2012 03:10:59 +0100
From: "Carlos J. G. Duarte" <carlos.j.g.dua...@gmail.com>
Subject: [Haskell-beginners] What's this [f| data |]  ??
To: beginners@haskell.org
Message-ID: <4ff3a633.8020...@gmail.com>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

Hi. I'm trying to get into haskell in my free time. I have already 
covered some syntax, but there's plenty to do yet, and when I'm 
consulting other people's stuff, I find lots of unknown constructs to 
me, which turns harder to lookup for, due to the very "symbolic" nature 
of Haskell.

For instance, on this http://www.yesodweb.com/blog/2012/04/yesod-js-todo 
they have a few constructs like this:

|mkYesod  "App"  [parseRoutes|
/HomeR  GET
/todoTodosR  GET  PUT
/todo/#TodoId  TodoR  GET  DELETE
|]|


It seems that the inline text is going to be fed to parseRoutes. How 
does that constructs work (links?)? I already know list comprehensions 
which appear to be related with this.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120704/dcef6919/attachment-0001.htm>

------------------------------

Message: 2
Date: Tue, 3 Jul 2012 22:30:58 -0400
From: Jack Henahan <jhena...@uvm.edu>
Subject: Re: [Haskell-beginners] What's this [f| data |]  ??
To: "Carlos J. G. Duarte" <carlos.j.g.dua...@gmail.com>
Cc: beginners@haskell.org
Message-ID: <db99b310-c54e-4362-8d3b-65a7e333e...@uvm.edu>
Content-Type: text/plain; charset="iso-8859-1"

parseRoutes is a quasiquoter [1]. It uses a type-safe metaprogramming language 
called Template Haskell [2] to parse a string as a Route (e.g., HomeR is a 
Route describing the base resource). You can see the source here [3]. I'm 
pretty new with Yesod, myself, so I'm sure someone else will give you a more in 
depth description shortly.

[1]: http://www.haskell.org/haskellwiki/Quasiquotation
[2]: http://www.haskell.org/haskellwiki/Template_Haskell
[3]: 
http://hackage.haskell.org/packages/archive/yesod-routes/1.0.1.2/doc/html/src/Yesod-Routes-Parse.html#parseRoutes

On Jul 3, 2012, at 10:10 PM, Carlos J. G. Duarte wrote:

> Hi. I'm trying to get into haskell in my free time. I have already covered 
> some syntax, but there's plenty to do yet, and when I'm consulting other 
> people's stuff, I find lots of unknown constructs to me, which turns harder 
> to lookup for, due to the very "symbolic" nature of Haskell.
> 
> For instance, on this http://www.yesodweb.com/blog/2012/04/yesod-js-todo they 
> have a few constructs like this:
> 
> mkYesod "App"
>  [parseRoutes|
> / 
> HomeR GET
> 
> /todo 
> TodosR GET PUT
> 
> /todo/#
> TodoId TodoR GET DELETE
> 
> |]
> 
> 
> It seems that the inline text is going to be fed to parseRoutes. How does 
> that constructs work (links?)? I already know list comprehensions which 
> appear to be related with this. 
> 
> Thanks.
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120703/3f3913a6/attachment-0001.pgp>

------------------------------

Message: 3
Date: Tue, 3 Jul 2012 22:32:28 -0400
From: David McBride <toa...@gmail.com>
Subject: Re: [Haskell-beginners] What's this [f| data |] ??
To: "Carlos J. G. Duarte" <carlos.j.g.dua...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CAN+Tr40i2kX371kKcH0Gb30Afw8-fne=4MK+kNy1c7Jj6z+=c...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

This is quasiquoting.  It is a pretty advanced topic, but it allows
you to take an arbitrary string and parse it with a quasiquoter of
your choice (in this case, parseRoutes) into some structure or
another.  Yesod uses it all over the place to generate html,
javascript, routing tables, and such.

On Tue, Jul 3, 2012 at 10:10 PM, Carlos J. G. Duarte
<carlos.j.g.dua...@gmail.com> wrote:
> Hi. I'm trying to get into haskell in my free time. I have already covered
> some syntax, but there's plenty to do yet, and when I'm consulting other
> people's stuff, I find lots of unknown constructs to me, which turns harder
> to lookup for, due to the very "symbolic" nature of Haskell.
>
> For instance, on this http://www.yesodweb.com/blog/2012/04/yesod-js-todo
> they have a few constructs like this:
>
> mkYesod "App" [parseRoutes|
> / HomeR GET
> /todo TodosR GET PUT
> /todo/#TodoId TodoR GET DELETE
> |]
>
>
> It seems that the inline text is going to be fed to parseRoutes. How does
> that constructs work (links?)? I already know list comprehensions which
> appear to be related with this.
>
> Thanks.
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



------------------------------

Message: 4
Date: Tue, 3 Jul 2012 22:33:04 -0400
From: Brent Yorgey <byor...@seas.upenn.edu>
Subject: Re: [Haskell-beginners] What's this [f| data |]  ??
To: beginners@haskell.org
Message-ID: <20120704023304.ga15...@seas.upenn.edu>
Content-Type: text/plain; charset=us-ascii

On Wed, Jul 04, 2012 at 03:10:59AM +0100, Carlos J. G. Duarte wrote:
> Hi. I'm trying to get into haskell in my free time. I have already
> covered some syntax, but there's plenty to do yet, and when I'm
> consulting other people's stuff, I find lots of unknown constructs to
> me, which turns harder to lookup for, due to the very "symbolic"
> nature of Haskell.
> 
> For instance, on this
> http://www.yesodweb.com/blog/2012/04/yesod-js-todo they have a few
> constructs like this:
> 
> |mkYesod  "App"  [parseRoutes|
> /HomeR  GET
> /todoTodosR  GET  PUT
> /todo/#TodoId  TodoR  GET  DELETE
> |]|
> 
> 
> It seems that the inline text is going to be fed to parseRoutes. How
> does that constructs work (links?)? I already know list
> comprehensions which appear to be related with this.

It does kind of look like a list comprehension, but it's actually
entirely unrelated -- it's quasiquotation:

http://www.haskell.org/haskellwiki/Quasiquotation

-Brent



------------------------------

Message: 5
Date: Tue, 3 Jul 2012 23:43:48 -0300
From: Felipe Almeida Lessa <felipe.le...@gmail.com>
Subject: Re: [Haskell-beginners] What's this [f| data |] ??
To: "Carlos J. G. Duarte" <carlos.j.g.dua...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CANd=OGFou=qa4xe5qjpmkl68bytvu+rdqwv0lhx9q8qv5xx...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Tue, Jul 3, 2012 at 11:10 PM, Carlos J. G. Duarte
<carlos.j.g.dua...@gmail.com> wrote:
> For instance, on this http://www.yesodweb.com/blog/2012/04/yesod-js-todo
> they have a few constructs like this:
>
> mkYesod "App" [parseRoutes|
> / HomeR GET
> /todo TodosR GET PUT
> /todo/#TodoId TodoR GET DELETE
> |]
>
> It seems that the inline text is going to be fed to parseRoutes. How does
> that constructs work (links?)? I already know list comprehensions which
> appear to be related with this.

That's a Template Haskell (TH) quasi-quotation.  The 'parseRoutes'
function is the quasi-quoter.  Check [1] and [2] for starters =).
Also, don't be afraid to ask questions on the Yesod mailing list (of
which I'm a subscriber, too).

[1] http://www.haskell.org/haskellwiki/Quasiquotation
[2] 
http://www.haskell.org/ghc/docs/latest/html/users_guide/template-haskell.html#th-quasiquotation

Cheers,

-- 
Felipe.



------------------------------

Message: 6
Date: Tue, 3 Jul 2012 23:55:36 -0300
From: Felipe Almeida Lessa <felipe.le...@gmail.com>
Subject: Re: [Haskell-beginners] What's this [f| data |] ??
Cc: beginners@haskell.org
Message-ID:
        <CANd=ogexcyirplo1nvg1sepuana5j-ejp4pusd43mbwbk6m...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Four answers!  Sorry, but according to Gmail I won by 10 minutes =P.

Cheers, =)

-- 
Felipe.



------------------------------

Message: 7
Date: Wed, 04 Jul 2012 11:56:36 +0200
From: "Henk-Jan van Tuyl" <hjgt...@chello.nl>
Subject: Re: [Haskell-beginners] Using tls-extra for simple smtp
To: beginners@haskell.org, "Sarfraz K." <dragoon.emp...@yahoo.fr>
Message-ID: <op.wgw1wnbgpz0...@zen5.arnhem.chello.nl>
Content-Type: text/plain; charset=iso-8859-15; format=flowed;
        delsp=yes

On Tue, 03 Jul 2012 17:16:37 +0200, Sarfraz K. <dragoon.emp...@yahoo.fr>  
wrote:

> I am trying to write a simple script to send a mail via my gmail account.
:
>     test1 = do h <- connectTo server (PortNumber (fromIntegral port))
>                hSetBuffering h NoBuffering
>                write h "EHLO"
>                write h "STATTLS"
>                listen h

I am not an expert in this matter, but I think you must change the line
>                write h "STATTLS"
to:
>                write h "STARTTLS"

Regards,
Henk-Jan van Tuyl


-- 
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--



------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 49, Issue 6
****************************************

Reply via email to