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. Re:  Sending mail via SMTP (Anindya Mozumdar)
   2. Re:  Sending mail via SMTP (Salil Wadnerkar)
   3. Re:  Sending mail via SMTP (Robert Wills)
   4. Re:  Sending mail via SMTP (Tim Perry)
   5. Re:  FRP (Christopher Howard)
   6. Re:  Algorithmic Advances by Discovering Patterns in
      Functions (Jay Sulzberger)
   7. Re:  FRP (Darren Grant)


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

Message: 1
Date: Tue, 18 Sep 2012 20:10:30 +0530
From: Anindya Mozumdar <anindya.lugb...@gmail.com>
Subject: Re: [Haskell-beginners] Sending mail via SMTP
To: Salil Wadnerkar <rohsh...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <cadur+2yhk4fbplguo5x01qtwy2aaxaf4fncyyx4wcnwvjqu...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

> Does anybody know of any good libraries I can use to send a mail via
> google's SMTP? I found SMTPClient and HaskellNet. The former does not
> support TLS and the latter does not seem to have examples for using
> TLS to send an email via SMTP. Did anybody manage to do that?
>

A fellow beginner, so I don't have indepth knowledge of the subject.

But can this help -

http://stackoverflow.com/questions/8036680/haskell-smtp-over-ssl

http://www.haskell.org/pipermail/beginners/2012-July/010190.html



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

Message: 2
Date: Tue, 18 Sep 2012 23:08:50 +0800
From: Salil Wadnerkar <rohsh...@gmail.com>
Subject: Re: [Haskell-beginners] Sending mail via SMTP
To: Anindya Mozumdar <anindya.lugb...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CAHRrG0rMHFLoo7L__VPr_CJL0QYhd3oy+VMvWDAffjLazC=g...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi Aninda,

Thanks for your reply. Unfortunately, I have already tried out these
examples and they don't seem to work.
HaskellNet has a github repo. I will contact the author and see
whether I can find any solution.

Thanks
Salil

On Tue, Sep 18, 2012 at 10:40 PM, Anindya Mozumdar
<anindya.lugb...@gmail.com> wrote:
>> Does anybody know of any good libraries I can use to send a mail via
>> google's SMTP? I found SMTPClient and HaskellNet. The former does not
>> support TLS and the latter does not seem to have examples for using
>> TLS to send an email via SMTP. Did anybody manage to do that?
>>
>
> A fellow beginner, so I don't have indepth knowledge of the subject.
>
> But can this help -
>
> http://stackoverflow.com/questions/8036680/haskell-smtp-over-ssl
>
> http://www.haskell.org/pipermail/beginners/2012-July/010190.html



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

Message: 3
Date: Tue, 18 Sep 2012 17:41:52 +0100
From: Robert Wills <wrwi...@gmail.com>
Subject: Re: [Haskell-beginners] Sending mail via SMTP
To: Salil Wadnerkar <rohsh...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CALVz20_wHYys0eR4eC-px9-zaXyF+0k9_rt36U7Fihk=ud5...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I do not believe there is and support for ssl in HaskellNet at
present.  It has I believe
been looked at but it's not simple to implement.  The best way of
integrating tls would
be to implement smtp over conduit as http-conduit does.

On Tue, Sep 18, 2012 at 4:08 PM, Salil Wadnerkar <rohsh...@gmail.com> wrote:
> Hi Aninda,
>
> Thanks for your reply. Unfortunately, I have already tried out these
> examples and they don't seem to work.
> HaskellNet has a github repo. I will contact the author and see
> whether I can find any solution.
>
> Thanks
> Salil
>
> On Tue, Sep 18, 2012 at 10:40 PM, Anindya Mozumdar
> <anindya.lugb...@gmail.com> wrote:
>>> Does anybody know of any good libraries I can use to send a mail via
>>> google's SMTP? I found SMTPClient and HaskellNet. The former does not
>>> support TLS and the latter does not seem to have examples for using
>>> TLS to send an email via SMTP. Did anybody manage to do that?
>>>
>>
>> A fellow beginner, so I don't have indepth knowledge of the subject.
>>
>> But can this help -
>>
>> http://stackoverflow.com/questions/8036680/haskell-smtp-over-ssl
>>
>> http://www.haskell.org/pipermail/beginners/2012-July/010190.html
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



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

Message: 4
Date: Tue, 18 Sep 2012 10:01:14 -0700
From: Tim Perry <tim.v...@gmail.com>
Subject: Re: [Haskell-beginners] Sending mail via SMTP
To: beginners@haskell.org
Message-ID:
        <cafvgasxhhm6op0gqfiawmt0j4k9ynvztchnxvipjgqy0ksy...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Robert,

are you saying you got SMPT to work using the http-conduit library? If
so, that is great...I've never managed to get it to work. Do you have
any code you could share? Just a proof-of-concept (toy) program would
be great!

Tim

On Tue, Sep 18, 2012 at 9:41 AM, Robert Wills <wrwi...@gmail.com> wrote:
> I do not believe there is and support for ssl in HaskellNet at
> present.  It has I believe
> been looked at but it's not simple to implement.  The best way of
> integrating tls would
> be to implement smtp over conduit as http-conduit does.
>
> On Tue, Sep 18, 2012 at 4:08 PM, Salil Wadnerkar <rohsh...@gmail.com> wrote:
>> Hi Aninda,
>>
>> Thanks for your reply. Unfortunately, I have already tried out these
>> examples and they don't seem to work.
>> HaskellNet has a github repo. I will contact the author and see
>> whether I can find any solution.
>>
>> Thanks
>> Salil
>>
>> On Tue, Sep 18, 2012 at 10:40 PM, Anindya Mozumdar
>> <anindya.lugb...@gmail.com> wrote:
>>>> Does anybody know of any good libraries I can use to send a mail via
>>>> google's SMTP? I found SMTPClient and HaskellNet. The former does not
>>>> support TLS and the latter does not seem to have examples for using
>>>> TLS to send an email via SMTP. Did anybody manage to do that?
>>>>
>>>
>>> A fellow beginner, so I don't have indepth knowledge of the subject.
>>>
>>> But can this help -
>>>
>>> http://stackoverflow.com/questions/8036680/haskell-smtp-over-ssl
>>>
>>> http://www.haskell.org/pipermail/beginners/2012-July/010190.html
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners@haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



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

Message: 5
Date: Tue, 18 Sep 2012 13:20:06 -0800
From: Christopher Howard <christopher.how...@frigidcode.com>
Subject: Re: [Haskell-beginners] FRP
To: Haskell Beginners <beginners@haskell.org>
Message-ID: <5058e586.3090...@frigidcode.com>
Content-Type: text/plain; charset="iso-8859-1"

On 09/17/2012 12:09 PM, Kim-Ee Yeoh wrote:
> Ever wired up some simple electronic circuits? Take a flip-flop for
> instance. Suppose each electronic component was a Haskell function. How
> would you design their types in order for the whole program be
> functionally equivalent?
> 
> FRP is a theory for the design and construction of programs along such
> lines.
> 
> 
> -- Kim-Ee
> 
> 

Which FRP framework (i.e., Haskell package) is the best one to play with
for someone still trying to grasp the basics of FRP?

-- 
frigidcode.com
indicium.us

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120918/c9e5d88c/attachment-0001.pgp>

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

Message: 6
Date: Tue, 18 Sep 2012 17:20:07 -0400 (EDT)
From: Jay Sulzberger <j...@panix.com>
Subject: Re: [Haskell-beginners] Algorithmic Advances by Discovering
        Patterns in Functions
To: "beginners@haskell.org" <beginners@haskell.org>
Message-ID: <pine.neb.4.64.1209181634100.7...@panix3.panix.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed



On Sat, 15 Sep 2012, Costello, Roger L. <coste...@mitre.org> wrote:

> Hi Folks,

< ... />

> Okay, now we are ready to embark on our journey of discovery. We will examine 
> three functions and find their common pattern.
>
> The functions process values from this recursive data type:
>
> data Nat = Zero | Succ Nat
>
> Here are some examples of Nat values:
>
> Zero, Succ Zero, Succ (Succ Zero), Succ (Succ (Succ Zero)), ...
>
> The following functions perform addition, multiplication, and exponentiation 
> on Nat values. Examine the three functions. Can you discern a pattern?
>
> -- Addition of Nat values:
> m + Zero = m
> m + Succ n = Succ(m + n)
>
> -- Multiplication of Nat values:
> m * Zero = Zero
> m * Succ n = (m * n) + m
>
> -- Exponentiation of Nat values:
> m ** Zero = Succ Zero
> m ** Succ n = (m ** n) * m
>
> For each function the right-hand operand is either Zero or Succ n:
>
> (+m) Zero
> (+m) Succ n
>
> (*m) Zero
> (*m) Succ n
>
> (**m) Zero
> (**m) Succ n
>
> So abstractly there is a function f that takes as argument either Zero or 
> Succ n:
>
> f Zero
> f Succ n
>
> Given Zero as the argument, each function immediately returns a value:
>
> (+m)  Zero    = m
> (*m)  Zero    = Zero
> (**m) Zero    = Succ Zero
>
> Let c denote the value.
>
> So, invoke f with a value for c and Zero:
>
> f c Zero = c
>
> For addition provide m as the value for c:
>
> m + Zero = f m Zero
>
> For multiplication provide Zero as the value for c:
>
> m * Zero = f Zero Zero
>
> For exponentiation provide (Succ Zero) as the value for c:
>
> m ** Zero = f (Succ Zero) Zero
>
> Next, consider how each of the functions (addition, multiplication, 
> exponentiation) deals with Succ n.
>
> Given the argument Succ n,  each function processes n and then applies a 
> function to the result:
>
> (+m)  Succ n          = (Succ)((+m) n)
> (*m)  Succ n          = ((*m) n) (+m)
> (**m) Succ n  = ((**m) n) (*m)
>
> Let h denote the function that is applied to the result.
>
> So, Succ n is processed by invoking f with a value for h and Succ n:
>
> f h (Succ n) = h (f n)
>
> For multiplication provide (+m) as the value for h:
>
> m * Succ n = f (+m) (Succ n)
>
> Recall that (+m) is a function: it takes one argument and returns the sum of 
> the argument and m.
>
> Thus one of the arguments of function f is a function.
>
> f is said to be a higher order function.
>
> [Definition: A higher order function is a function that takes an argument 
> that is a function or it returns a function.]
>
> Continuing on with the other values for h:
>
> For addition provide (Succ) as the value for h:
>
> m + Succ n = f (Succ) (Succ n)
>
> For exponentiation provide (*m) as the value for h:
>
> m ** Zero = f (*m) (Succ n)
>
> Recap: to process Nat values use these equations:
>
> f c Zero = c
> f h (Succ n) = h (f n)
>
> Actually we need to supply f with h, c, and the Nat value:
>
> f h c Zero = c
> f h c (Succ n) = h (f h c n)
>
> f has this type signature: its arguments are a function, a value, and a Nat 
> value; the result is a value. So this is f's type signature:
>
> f :: function -> value -> Nat -> value
>
> That type signature is well-known in functional programming. It is the 
> signature of a fold function. Here is some intuition on why it is called the 
> fold function:
>
> Imagine folding a towel. You make your first fold. The second fold builds on 
> top of the first fold. Each fold builds on top of the previous folds. That is 
> analogous to what the function f does. "You make your first fold" is 
> analogous to immediately returning c:
>
> f h c Zero = c
>
> "Each fold builds on top of the previous folds" is analogous to processing 
> Succ n by applying h to the result of processing the n'th Nat value:
>
> f h c (Succ n) = h (f h c n)
>
> Recap: In analyzing the functions (addition, multiplication, exponentiation) 
> on Nat we have discovered that they are all doing a fold operation.
>
> That is a remarkable discovery.
>
> Let's now see how to perform addition, multiplication, and exponentiation 
> using f. However, since we now recognize that f is actually the fold 
> function, let's rename it foldn (fold Nat). Here is its type signature and 
> function definition:
>
> foldn                 :: (a -> a) -> a -> Nat -> a
> foldn h c Zero                =  c
> foldn h c (Succ n)    =  h (foldn h c n)
>
> The functions are implemented as:
>
> m + n                         = foldn Succ m n
> m * n                         = foldn (+m) Zero n
> m ** n                        = foldn (*m) (Succ Zero) n
>
> Let's take an example and trace its execution:
>
> Zero + Succ Zero
>       = foldn Succ Zero (Succ Zero)
>       = Succ (foldn Succ Zero Zero)
>       = Succ (Zero)
>
> The holy trinity of functional programming is:
>
> 1.  User-defined recursive data types.
> 2.  Recursively defined functions over recursive data types.
> 3.  Proof by induction: show that some property P(n) holds for each element 
> of a recursive data type.
>
> Nat is a user-defined recursive data type. The addition, multiplication, and 
> exponentiation functions are recursively defined functions over Nat.
>
> We saw that the fold function can be defined for the Nat data type. In fact, 
> a suitable fold function can be defined for every recursive data type.
>
> Wow!
>
> There are two advantages of writing recursive definitions in terms of fold:
>
> 1.  The definitions are shorted; rather than having to write down two 
> equations, we have only to write down one.
> 2.  It is possible to prove general properties of fold and use them to prove 
> properties of specific instantiations. In other words, rather than having to 
> write down many inductive proofs, we have only to write down one.
>
> Recap: we have approached programming like a scientist; namely, we have 
> examined a set of algorithms (the addition, multiplication, and 
> exponentiation functions), discovered that they have a recurring pattern, and 
> then evolved the algorithms to a higher order algorithm. That is advancing 
> the field. Incremental advancements such as this is what takes Computer 
> Science to new heights.
>
> /Roger

A. V. Borovik has a introduction to mathematical logic, made just
of examples, called "Shadows of the Truth":

   http://www.maths.manchester.ac.uk/~avb/ST.pdf

In the draft 0.819, dated 25 January 2012, which I just now
pulled off the Net, chapter 5, which starts on page 45 (61 in my
pdf reader), has a discussion of how to define addition,
multiplication, and exponentiation, of positive integers,
starting from (a version of) Peano's Axioms.  I looked at the
book a few years ago and I remember that in this section there
appeared the question:

   Addition and multiplication obey the commutative law.
   Addition and multiplication obey the associative law.
   But exponentiation does not.
   Why?

I do not see this question posed explicitly in the chapter, I may
have missed it, but there does appear the fact:

   OK, addition and multiplication can be defined for Z/n (by which
   we mean the integers modulo n) by the "same" definition as is used
   for the positive integers.
   But that definition fails for exponentiation.


In Phil Wadler's video "Church's Coincidences"

   http://www.youtube.com/watch?v=3D2PJ_DbKGFUA

a note by S. C. Kleene is shown.  The note lays out a definition
of the inverse of the successor function, done for Church's
coding of the integers into (some variant, indeed the original)
lambda calculus.  There was some difficulty in finding the
definition.


Yesterday o...@okmij.org posted to Haskell-cafe a note with
subject "Church vs Boehm-Berarducci encoding of Lists".  There
the puzzle of how to define cdr in the encoding, and more
generally, how to do destructuring-bind^W"pattern matching",
Haskell sense, in the general case, is mentioned.


I think these three things

1. the difference between exponentiation and (addition and multiplication)

2. the difficulty of defining subtraction in Church's encoding of
    the non-negative integers

3. the difficulty of defining pattern matching in the
    Church-Boehm-Berarducci encoding

might have something to do with one another.

oo--JS.



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

Message: 7
Date: Tue, 18 Sep 2012 15:17:45 -0700
From: Darren Grant <therealklu...@gmail.com>
Subject: Re: [Haskell-beginners] FRP
To: Christopher Howard <christopher.how...@frigidcode.com>
Cc: Haskell Beginners <beginners@haskell.org>
Message-ID:
        <ca+jd6sgj+dctaysnasmcv5eetxd9w-xpac_xvakugogq2wq...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I have found Reactive Banana to be the most accessible so far. Still
struggling with some of the language syntax though.

Cheers,
Darren


On Tue, Sep 18, 2012 at 2:20 PM, Christopher Howard
<christopher.how...@frigidcode.com> wrote:
> On 09/17/2012 12:09 PM, Kim-Ee Yeoh wrote:
>> Ever wired up some simple electronic circuits? Take a flip-flop for
>> instance. Suppose each electronic component was a Haskell function. How
>> would you design their types in order for the whole program be
>> functionally equivalent?
>>
>> FRP is a theory for the design and construction of programs along such
>> lines.
>>
>>
>> -- Kim-Ee
>>
>>
>
> Which FRP framework (i.e., Haskell package) is the best one to play with
> for someone still trying to grasp the basics of FRP?
>
> --
> frigidcode.com
> indicium.us
>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



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

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


End of Beginners Digest, Vol 51, Issue 27
*****************************************

Reply via email to