RE: [Haskell-cafe] RFE: Extensible algebraic user-defined data types?

2005-04-29 Thread Simon Peyton-Jones
| Regarding reusing constructor names across several datatypes: is it | possible to qualify them with their enclosing datatype name, like | Maybe.Nothing where there is a name conflict? Then I might reuse | Nothing in my hypothetical data type, and it would be NEither.Nothing | if conflicting with

RE: [Haskell-cafe] RFE: Extensible algebraic user-defined data types?

2005-04-29 Thread Simon Peyton-Jones
| Suppose I want to extend this datatype to the one including | possibility of neither Left or Right (i. e. None). Currently I have to | use Maybe Either, so my options are: | | Just (Left a) | Just (Right b) | Nothing | | If I could extend the Either datatype I might have (syntax may be |

[Haskell-cafe] Re: about Ghci

2005-04-29 Thread Henning Thielemann
On Thu, 28 Apr 2005, Peter Simons wrote: SCOTT J writes: What do I have to do in order not having to type always :set -fglasgow-exts Add the line {-# OPTIONS -fglasgow-exts #-} at the top of the source code. Then the flag will be set when you load the module. This option is local to each

[Haskell-cafe] RE: RFE: Extensible algebraic user-defined data types?

2005-04-29 Thread Henning Thielemann
On Fri, 29 Apr 2005, Simon Peyton-Jones wrote: | Regarding reusing constructor names across several datatypes: is it | possible to qualify them with their enclosing datatype name, like | Maybe.Nothing where there is a name conflict? Then I might reuse | Nothing in my hypothetical data type, and it

RE: [Haskell-cafe] fptools in darcs now available

2005-04-29 Thread Simon Marlow
On 28 April 2005 16:02, John Goerzen wrote: 3. Rename the smaller project's files as appropriate 4. Checkpoint here Won't that leave a lot of useless history in each individual project? When I do 'darcs get' locally to check out a few sub-repositories, won't I get N copies of all the old

[Haskell-cafe] Re: fptools in darcs now available

2005-04-29 Thread Peter Simons
Simon Marlow writes: if I just want to check out e.g. Haddock, I have to get the entire fptools repo (350M+, wasn't it?). I guess the best way to do that with Darcs would be to (1) pull the fp-tools repository, (2) delete all files you don't need for Haddock, (3) pull that into your

Re: [Haskell-cafe] RFE: Extensible algebraic user-defined data types?

2005-04-29 Thread Keean Schupke
David Menendez wrote: The downside is that a function that might normally be typed Either A B - C now will have the type: (HTypeIndexed l, HTypeProxied l, HOccurs (Proxy (Left A)) l, HOccurs (Proxy (Right B)) l) = TIC l - C But it will accept a TIC (HEither A B) and a TIC

RE: [Haskell-cafe] RFE: Extensible algebraic user-defined data types?

2005-04-29 Thread Philippa Cowderoy
On Fri, 29 Apr 2005, Simon Peyton-Jones wrote: 2. Use sub-typing, so that a value (Left x) is *both* in type Either and in type NEither. This opens a very large and complicated design space, as Ben mentioned. I've been playing with this design space for a while and think there's at least one

Re: [Haskell-cafe] RFE: Extensible algebraic user-defined data types?

2005-04-29 Thread Jacques Carette
Philippa Cowderoy [EMAIL PROTECTED] wrote: On Fri, 29 Apr 2005, Simon Peyton-Jones wrote: 2. Use sub-typing, so that a value (Left x) is *both* in type Either and in type NEither. This opens a very large and complicated design space, as Ben mentioned. I've been playing with this design space

Re: [Haskell-cafe] fptools in darcs now available

2005-04-29 Thread John Goerzen
On Fri, Apr 29, 2005 at 10:39:13AM +0100, Simon Marlow wrote: On 28 April 2005 16:02, John Goerzen wrote: Yes, but they'll all be hardlinked together, so no matter how many copies you get, the old history is only stored on disk once. If I do 'darcs get' to get a bunch of different

Re: [darcs-users] Re: [Haskell-cafe] fptools in darcs now available

2005-04-29 Thread John Goerzen
On Fri, Apr 29, 2005 at 11:17:07AM -0300, [EMAIL PROTECTED] wrote: The only tricky part is doppleganger patches. Basically at this point if you get doppleganger patches then you should manually intervene, figure out what the conflict is, manually fix it, and then resume. It's a big problem,

Re: [Haskell-cafe] Writing functions in Haskell.

2005-04-29 Thread Ross Paterson
On Thu, Apr 28, 2005 at 09:22:15PM -0400, Cale Gibbard wrote: The second problem arises from hugs not doing the same thing as ghci with respect to looking up qualified variable names (that is, those with the module name specified, in this case, the standard module Char). You can tell hugs to

Re: [Haskell-cafe] Writing functions in Haskell.

2005-04-29 Thread Hal Daume III
Hal: Char.toUpper and Char.isLower in Chapter 3 seem to be a perennial stumbling block for Hugs users -- could you suggest that Hugs users load Char and just say toUpper and isLower instead? I just added a note about this :). Though the tutorial is mirrored in so many places by now, I'm