Hi Raeck, as I see what types you defined, don't you doing School of
Expression? (In summer I made my way to FAL chapter, but I had no time more
(school), but I will definitely finish that book:)
Fero
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.o
Here's a tip: leave off the type signature, and ask ghci what it is.
$ ghci
Prelude> let contain x [] = False ; contain x (y:ys) = if x == y then
True else contain x ys
Prelude> :t contain
contain :: (Eq a) => a -> [a] -> Bool
-- ryan
2008/12/22 Raeck Zhao :
> I am trying to define a containin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
On Tue, Dec 23, 2008 at 10:48 PM, Henning Thielemann wrote:
> Andrew Wagner schrieb:
>> The problem here is even slightly deeper than you might realize. For
>> example, what if you have a list of functions. How do you compare two
>> functions to eac
Andrew Wagner schrieb:
> The problem here is even slightly deeper than you might realize. For
> example, what if you have a list of functions. How do you compare two
> functions to each other to see if they're equal? There is no good way
> really to do it! So, not only is == not completely polymorp
2008/12/22 Raeck Zhao
> Thank you very much for your reply! It is really helpful!
>
> But I just found another 'problem', I just realize that the list does not
> support the user-defined data type?
> the list is also depending on the Eq function?
>
> For example,
>
> data Shape = Square | Triang
On 22 Dec 2008, at 17:35, Raeck Zhao wrote:
But I just found another 'problem', I just realize that the list
does not support the user-defined data type?
Don't worry, it does.
the list is also depending on the Eq function?
No, it doesn't.
data Shape = Square | Triangle | Circle
[Squar
s
>
> Raeck
>
>
> --
> Date: Mon, 22 Dec 2008 09:02:53 -0500
> From: wagner.and...@gmail.com
> To: ra...@msn.com
> Subject: Re: [Haskell-cafe] Defining a containing function on polymorphic
> list
> CC: haskell-cafe@haskell.org; beginn...@h
2:53 -0500
From: wagner.and...@gmail.com
To: ra...@msn.com
Subject: Re: [Haskell-cafe] Defining a containing function on polymorphic list
CC: haskell-cafe@haskell.org; beginn...@haskell.org
The problem here is even slightly deeper than you might realize. For example,
what if you have a list of func
On 22 Dec 2008, at 15:18, Andrew Wagner wrote:
Yes, of course, sorry for the typo.
On Mon, Dec 22, 2008 at 9:17 AM, Denis Bueno wrote:
2008/12/22 Andrew Wagner :
> The problem here is even slightly deeper than you might realize. For
> example, what if you have a list of functions. How do you
Yes, of course, sorry for the typo.
On Mon, Dec 22, 2008 at 9:17 AM, Denis Bueno wrote:
> 2008/12/22 Andrew Wagner :
> > The problem here is even slightly deeper than you might realize. For
> > example, what if you have a list of functions. How do you compare two
> > functions to each other to s
2008/12/22 Andrew Wagner :
> The problem here is even slightly deeper than you might realize. For
> example, what if you have a list of functions. How do you compare two
> functions to each other to see if they're equal? There is no good way really
> to do it! So, not only is == not completely poly
The problem here is even slightly deeper than you might realize. For
example, what if you have a list of functions. How do you compare two
functions to each other to see if they're equal? There is no good way really
to do it! So, not only is == not completely polymorphic, but it CAN'T be.
There is
I am trying to define a containing function to see if a value is one
of the elements within a list which is polymorphic, but failed with the
following codes:
> contain :: a -> [a] -> Bool
> contain x [] = False
> contain x (y:ys) = if x == y then True else contain x ys
it seems that the pr
13 matches
Mail list logo