MyState, Int...
Simon
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Ashley Yakeley
| Sent: 28 June 2003 00:25
| To: [EMAIL PROTECTED]
| Subject: Re: Language extension proposal
|
| In article [EMAIL PROTECTED],
| Andrew J Bromage [EMAIL PROTECTED
If we could only figure out a good syntax for
(optional) type application, it would deal rather nicely with many of
these cases. Trouble is, '..' gets confused with comparisons. And
when there are multiple foralls, it's not obvious what order to supply
the type parameters.
What about
At 2003-06-30 01:55, Ralf Hinze wrote:
What about
mantissa (| Double |) + 4 ?
This would work perfectly with my method if (| Double |) were syntactic
sugar for (mkType :: Type Double) or similar. I really think it's the
most straightforward way of doing it and I hazard the easiest to
Hi
There's nothing wrong with this in principle; the difficulty is that
when you say
mantissa + 4
you aren't saying which float type to get the mantissa of. Earlier
messages have outlined workarounds, but in some ways the real solution
is to provide a syntax for type application.
Ashley Yakeley wrote:
Oh I do this all the time in HBase. I simply do this:
data Type a = MkType
getType :: a - Type a
getType _ = MkType
class (Bounded a) = FloatTraits a where
epsilon :: a
mantissaDigits :: Type a - Int
Suffering from persecution mania,
I prefer to know
At 2003-06-28 02:51, Ralf Laemmel wrote:
Suffering from persecution mania,
I prefer to know for sure that nobody never ever will
pattern match on those a's. So I prefer to write:
I don't understand. Did you mean pattern-match on MkType? I could stop
that by hiding it but exposing mkType =
Ashley Yakeley wrote:
At 2003-06-28 02:51, Ralf Laemmel wrote:
Suffering from persecution mania,
I prefer to know for sure that nobody never ever will
pattern match on those a's. So I prefer to write:
I don't understand. Did you mean pattern-match on MkType? I could stop
that by hiding
In article [EMAIL PROTECTED],
Andrew J Bromage [EMAIL PROTECTED] wrote:
Another example is floating point format information, like the
information in C's float.h. One might implement this as:
class (Bounded a) = FloatTraits a where
epsilon :: a-- OK
I'm not sure this is really necessary (at least syntax-wise).
We can do something like:
data T a
class Trait a where { trait :: T a - Int }
instance Trait Int where { trait _ = 0 }
instance Trait Char where { trait _ = 1 }
As far as I can tell with the various --ddump-* flags, the
G'day all.
On Wed, Jun 25, 2003 at 08:48:12AM -0700, Hal Daume wrote:
I'm not sure this is really necessary (at least syntax-wise).
Well, of course, no extension is absolutely necessary in a Turing-hard
language. :-)
For the record, here are a couple of other solutions which avoid the
10 matches
Mail list logo