Re: overlapping instances and functional dependencies

2003-08-20 Thread oleg
Wolfgang Jeltsch has observed: > I have this code: > class C a b c | a b -> c where > f :: a -> b -> c > > instance C a b c => C a (x,y,b) c where > f a (_,_,b) = f a b > > instance C a (a,c,b) c where > f _ (_,c,_) = c > ghci -fglasgow-exts -fallow-overlapping-

Re: "let" vs. "where"

2003-08-20 Thread Hamilton Richards
At 7:42 AM +0200 8/20/03, Jan Scheffczyk wrote: Hi Andrew, let x = expensiveComputation foo in x + x I would certainly hope that expensiveComputation wasn't called twice, and even though the language doesn't guarantee it, I have already written code that assumed it. I always thought that ther

Re: container for different types, avoiding boiler plate

2003-08-20 Thread Derek Elkins
On Wed, 20 Aug 2003 08:25:39 -0700 "Hal Daume" <[EMAIL PROTECTED]> wrote: > I use my 'DynamicMap' type to handle this sort of thing. However, I > don't really recommend this approach unless you're very careful. You > basically lose out on all nice type checking properties and enter a > world of

Re: 'Forest inversion'?

2003-08-20 Thread Ralf Hinze
Dear Marnix, your transformation can be rewritten as the composition of three functions: one that converts the forest into a binary tree (this is based on the natural correspondence between forests and binary trees (*), see Knuth TAOCP, Vol 1), one that mirrors a binary tree swapping left and righ

RE: container for different types, avoiding boiler plate

2003-08-20 Thread Hal Daume
I use my 'DynamicMap' type to handle this sort of thing. However, I don't really recommend this approach unless you're very careful. You basically lose out on all nice type checking properties and enter a world of dynamic typing (more or less). Anyway, you can find it at: http://www.isi.edu/~h

GPCE 03 Call for Participation

2003-08-20 Thread Akos Ledeczi
GPCE'03: 2nd International Conference on Generative Programming and Component Engineering In Cooperation with ACM SIGPLAN and SIGSOFT and co-located at NetObjectDays'03 September 22-25, 2003, Erfurt, Germany

Weighted Automata: Workshop Announcement

2003-08-20 Thread Sandra Grossmann
[apologies if you receive multiple copies of this message] --- Weighted Automata: Theory and Applications Dresden University of Technology, June 1 - 5, 2004 The workshop will cover all aspects of weighted automata, ranging from the theory of

container for different types, avoiding boiler plate

2003-08-20 Thread Markus . Schnell
I think similar things have been asked before, but I couldn't find anything specific. I have a data type with attributes. These attributes have different types. Right now I'm using a lot of boilerplate like that: > data Gender = Masc | Fem | Neutr > ... > data Attr= Gender Gender | Cat Cat

'Forest inversion'?

2003-08-20 Thread Marnix Klooster
Hi all, Recently I've discovered an inversion operation on forests that transforms 'wide' forests into 'deep' onces and vice versa. I'm sure that this operation is already known, however, I could not find any information on it. (Largely because I don't know under what name to look for it.) You H