Cool!

Is there *anything* Haskell *can't* do?

Michael

--- On Mon, 5/18/09, David Menendez <[email protected]> wrote:

From: David Menendez <[email protected]>
Subject: Re: [Haskell-cafe] showing a user defined type
To: "Ryan Ingram" <[email protected]>
Cc: [email protected]
Date: Monday, May 18, 2009, 10:26 PM

On Mon, May 18, 2009 at 10:02 PM, Ryan Ingram <[email protected]> wrote:
> Unfortunately, you can't derive Show on Chain as defined, because it
> contains a function:

Sure you can. I just tried the following, and it compiled without complaints.

> import Text.Show.Functions
>
> data Chain = Link Int (Int -> Chain) deriving (Show)

The usual warnings about orphan instances apply, but the purpose of
the Text.Show.Functions module is to provide a standard Show instance
for functions so that libraries (e.g., QuickCheck) don't declare
conflicting instances.

-- 
Dave Menendez <[email protected]>
<http://www.eyrie.org/~zednenem/>
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe



      
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to