RE: Language extension proposal

2003-06-30 Thread Simon Peyton-Jones
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

Re: Language extension proposal

2003-06-30 Thread Ralf Hinze
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

Re: Language extension proposal

2003-06-30 Thread Ashley Yakeley
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

RE: Language extension proposal

2003-06-30 Thread C T McBride
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.

Re: Language extension proposal

2003-06-28 Thread Ralf Laemmel
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

Re: Language extension proposal

2003-06-28 Thread Ashley Yakeley
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 =

Re: Language extension proposal

2003-06-28 Thread Ralf Laemmel
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

Re: Language extension proposal

2003-06-27 Thread Ashley Yakeley
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

RE: Language extension proposal

2003-06-25 Thread Hal Daume
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

Re: Language extension proposal

2003-06-25 Thread Andrew J Bromage
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