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:  DB + CSV + Mail (David McBride)
   2. Re:  DB + CSV + Mail (Christopher Allen)
   3. Re:  Type constructors sharing a common field (Thomas Hallgren)


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

Message: 1
Date: Tue, 29 Apr 2014 16:54:18 -0400
From: David McBride <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] DB + CSV + Mail
Message-ID:
        <can+tr41suqdrqpwuftcdoe0pirdtgqn3j8x3ac79ogqzzid...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Use mysql-simple/postgresql-simple for database.  Use cassava for csv, and
umm I know there is a library for mailing, but I don't recall what it is.


On Tue, Apr 29, 2014 at 2:50 PM, Ari King <[email protected]>wrote:

> Hi,
>
> I'd like to port a python script that queries a DB, writes the results to
> a CSV file, and emails that file. I'd appreciate suggestions on libraries
> and/or approaches that can help me achieve this.
>
> For DB querying I was thinking of using HDBC.
>
> Best,
> Ari
>
> _______________________________________________
> 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/20140429/700cbdb1/attachment-0001.html>

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

Message: 2
Date: Tue, 29 Apr 2014 15:56:23 -0500
From: Christopher Allen <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] DB + CSV + Mail
Message-ID:
        <cadnndorohoxsadqb8de1ewmfh+j7ct5xua_s_hfp+s5dnoy...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

https://hackage.haskell.org/package/smtp-mail


On Tue, Apr 29, 2014 at 3:54 PM, David McBride <[email protected]> wrote:

> Use mysql-simple/postgresql-simple for database.  Use cassava for csv, and
> umm I know there is a library for mailing, but I don't recall what it is.
>
>
> On Tue, Apr 29, 2014 at 2:50 PM, Ari King <[email protected]>wrote:
>
>> Hi,
>>
>> I'd like to port a python script that queries a DB, writes the results to
>> a CSV file, and emails that file. I'd appreciate suggestions on libraries
>> and/or approaches that can help me achieve this.
>>
>> For DB querying I was thinking of using HDBC.
>>
>> Best,
>> Ari
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>>
>
> _______________________________________________
> 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/20140429/08530033/attachment-0001.html>

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

Message: 3
Date: Wed, 30 Apr 2014 11:02:44 +0100
From: Thomas Hallgren <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Type constructors sharing a common
        field
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

On 2014-04-28 19:26, Lorenzo Tabacchini wrote:
> Imagine the following data type:
> 
> data Person = Child { childAge :: Int, school :: School }
>             | Adult { adultAge :: Int, job :: Job }
> 
> Both the alternatives share an "age" field, but in order to access it we are
> obliged to match all the constructors:
> 
> personAge :: Person -> Int
> personAge (Child {childAge = age}) = age
> personAge (Adult {adultAge = age}) = age
>  Is there a way to define a common field in a data type (somehow like 
> inheritance in the OOP world)?


Yes, there is:

  data Person = Child { personAge :: Int, school :: School }
              | Adult { personAge :: Int, job :: Job }


No extension needed!

Thomas H



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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 70, Issue 54
*****************************************

Reply via email to