Nicholls, Mark wrote:
data Shape = Circle Int
| Rectangle Int Int
| Square Int
Isn't this now closed...i.e. the statement is effectively defining
that shape is this and only ever thisi.e. can I in another module
add new types of Shape?
Yes, but in most cases,
Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of apfelmus
Sent: 17 December 2007 12:34
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Re: OOP'er with (hopefully) trivial
questions.
Nicholls, Mark wrote:
data Shape = Circle Int
| Rectangle Int
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nicholls, Mark
The open case (as in OO) seems to be more like the Haskell class
construct, i.e. if new types declare themselves to be members
of a class
then they must satisfy certain constaintsI can then
specify equals
On Dec 17, 2007 1:18 PM, Nicholls, Mark [EMAIL PROTECTED] wrote:
Not really with this...
The open case (as in OO) seems to be more like the Haskell class
construct, i.e. if new types declare themselves to be members of a class
then they must satisfy certain constaintsI can then specify
On Dec 17, 2007 8:18 AM, Nicholls, Mark [EMAIL PROTECTED] wrote:
The approach is deliberate...but I accept may be harder than it needs to
be...I'm interested in Haskell because of the alleged power/formality of
it's type system against the relatively weakness of OO ones...the irony
at the
Thomas Davie wrote:
Take a look at the Typable class. Although, pretty much any code that
you can compile can be loaded into ghci without modification, and that's
by far the easier way of finding the types of things.
Is there a way to make ghci to know also the symbols which are not
There was a thread about this recently.
In any case, if you load the code interpreted (which happens if there
is no .o or .hi file of the module lying around), then you can
look inside all you want. But if it loads compiled, then you only
have access to the exported symbols. The reason is
Luke Palmer wrote:
There was a thread about this recently.
In any case, if you load the code interpreted (which happens if there
is no .o or .hi file of the module lying around), then you can
look inside all you want. But if it loads compiled, then you only
have access to the exported symbols.