[Haskell-cafe] ReRe: Basic question concerning data constructors
webmaster at h-labahn.de
Sun Dec 30 13:32:02 EST 2007
Thanks to both fast answers.
there remain problems with Jakes mail for me. This:
> When you define datatypes, you are essentially defining a type-level
> constructors on the left hand side and (value-level) constructors on
> the right hand side.
is very useful for me. "data" defines TWO constructors, ok. And if i want
construction on the type level, then the arguments must obviously be
type-"valued", means parameters. From this i conclude, that
data ClockTime Integer Integer = ...
would never make sense, whatever on the right size. The next isn't
understandable for me - i have not the slightest conception of dependently
Then i arrive at
> . Now, let's say we had tried defining ClockTime with parameters as
> you suggested.
> ClockTime' :: Integer -> Integer -> *
> Do you see the problem? In order to use the ClockTime type
> constructor, we would have to use Integer values.
Cannot see any problem here - do we NOT want ClockTime to be initialized by two
Integers ? Or is this the main reason for introducing "TOD" - to be able to
change it without having to make any changes to code using ClockTime ?
To repeat myself - am i right understanding, that this needs a differently named
data constuctor ?
(I cited "abstract type" from the library reference. Not
important for me at the moment, what that means in Haskell.)
Thanks for your attention, Joost
More information about the Haskell-Cafe