[Haskell-cafe] Dealing with heterogeneously-typed lists?

Thomas Davie tom.davie at gmail.com
Wed Aug 13 03:22:31 EDT 2008


On 13 Aug 2008, at 00:44, Leif Warner wrote:

> Hi all,
> I'm dealing with some datatype, say:
> data Invoice =
>     Invoice       { invoiceNum    :: String,
>                     dollarAmt     :: Currency,
>                     printDate     :: Date,
>
>                     dueDate       :: Date,
>                     vendorNum     :: Int,
>                     vendorName    :: String,
>                     isStock       :: Bool,
>                   }
You probably don't want to put these things into a list at all.   
Instead, you want to define an Instance of the Show class for Invoice.

Bob



More information about the Haskell-Cafe mailing list