[Haskell-cafe] showing a user defined type

Miguel Mitrofanov miguelimo38 at yandex.ru
Tue May 19 10:26:52 EDT 2009



michael rice wrote on 19.05.2009 18:16:
> Cool!
> 
> Is there *anything* Haskell *can't* do?

Well, I haven't found a way to emulate polymorphics kinds yet, and I feel like I need them. Other than than - probably no.


> 
> Michael
> 
> --- On *Mon, 5/18/09, David Menendez /<dave at zednenem.com>/* wrote:
> 
> 
>     From: David Menendez <dave at zednenem.com>
>     Subject: Re: [Haskell-cafe] showing a user defined type
>     To: "Ryan Ingram" <ryani.spam at gmail.com>
>     Cc: haskell-cafe at haskell.org
>     Date: Monday, May 18, 2009, 10:26 PM
> 
>     On Mon, May 18, 2009 at 10:02 PM, Ryan Ingram <ryani.spam at gmail.com
>     </mc/compose?to=ryani.spam at gmail.com>> 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 <dave at zednenem.com </mc/compose?to=dave at zednenem.com>>
>     <http://www.eyrie.org/~zednenem/ <http://www.eyrie.org/%7Ezednenem/>>
>     _______________________________________________
>     Haskell-Cafe mailing list
>     Haskell-Cafe at haskell.org </mc/compose?to=Haskell-Cafe at haskell.org>
>     http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


More information about the Haskell-Cafe mailing list