Re: [Haskell] Per-type function namespaces

2004-02-26 Thread Ketil Malde
Peter Strand <[EMAIL PROTECTED]> writes: > That is, a function is looked up in the namespaces of its arguments as > well as in the normal places. So "add fm k v" where fm :: FiniteMap, > x :: Int, v :: String would look for "add" in the modules where > FiniteMap, Int and String was defined. I sup

Re: [Haskell] regular expression syntax - perl ain't got nothin on haskell

2004-02-26 Thread Ross Paterson
On Tue, Feb 24, 2004 at 05:24:41PM -, Simon Marlow wrote: > [Graham Klyne wrote:] > > I recently ran into some problems porting some Haskell code > > to Windows > > because it used the Text.Regex library, which is dependent on > > a Unix-only system. > > Text.Regex works fine on Windows, at

[Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread ozone
I've had an idea stewing in my head to do with per-type function namespaces, that the current module namespace discussion reminded me about. The problem is that there is a limited namespace for functions, so that if you define a new data type, it is unwise to call functions which work on that

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread Keith Wansbrough
> I've had an idea stewing in my head to do with per-type function > namespaces, that the current module namespace discussion reminded me > about. The problem is that there is a limited namespace for functions, > so that if you define a new data type, it is unwise to call functions > which wor

[Haskell] Haskell job (OH, USA)

2004-02-26 Thread Mark . Carroll
Aetion Technologies LLC seeks another high-quality programmer. Development is mostly in Haskell, with some Java, mostly under Linux. An ideal candidate is excellent at acquiring, applying, and writing about new knowledge. Additional background in disciplines like mathematics, science, engineering,

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread ozone
On 27/02/2004, at 3:47 AM, Keith Wansbrough wrote: I've had an idea stewing in my head to do with per-type function namespaces, that the current module namespace discussion reminded me about. The problem is that there is a limited namespace for functions, so that if you define a new data type, i

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread Abraham Egnor
I think that this is a problem that can be solved with a simple convention change, rather than a language extension - instead of appending type names, I think it would be much better if modules simply used the short, convenient, common names and expected the user to import them qualified where over

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread ozone
On 27/02/2004, at 8:28 AM, Abraham Egnor wrote: I think that this is a problem that can be solved with a simple convention change, rather than a language extension - instead of appending type names, I think it would be much better if modules simply used the short, convenient, common names and ex

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread Ketil Malde
[EMAIL PROTECTED] writes: > addToFM :: Ord key => FiniteMap key elt -> key -> elt -> FiniteMap key > elt > addToSet :: Ord a => Set a -> a -> Set a > So, how can you come up with a type class which provides a > polymorphic 'add' function, considering you don't even know how many > parameters eac

Re: [Haskell] Per-type function namespaces

2004-02-26 Thread Peter Strand
[EMAIL PROTECTED] wrote: I've had an idea stewing in my head to do with per-type function namespaces, . The idea that I've been throwing around is to be able to define a separate namespace for each type; a function can either belong in a "global" (default) namespace, or belong in a particul

RE: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread David Bergman
Mr. Ozone wrote: [snip] > So at the moment, many Haskellers will append the type name to the > function to indicate that it only works on that particular data type. > In this respect, Haskell is at a disadvantage vs most object-oriented > languages, because in them, you can write "x.add", and t

Re: [Haskell] Re: Data.Set whishes

2004-02-26 Thread Chris Moline
Alastair Reid <[EMAIL PROTECTED]> wrote: > Haskell's module system provides a way for a module to merge multiple > modules into one but provides no way to eliminate any ambiguities this > may create. If we want to be able to use names like 'create' instead > of 'createFont', we need to change the

RE: [Haskell] performance tuning Data.FiniteMap

2004-02-26 Thread S. Alexander Jacobson
Is fixing GHC arrays a big research job or is it something that someone can straightforwardly handle if my site actually gets enough traffic to warrant it? -Alex- On Thu, 26 Feb 2004, Simon Peyton-Jones wrote: > | But in managing this tradeoff, what is faster: > | * constructing/destructing e.g.

[Haskell] Regular Expressions - take 2

2004-02-26 Thread John Meacham
I went ahead and implemented Perl Compatable Regular Expression support as well as a module which uses template haskell to check regular expressions at runtime. The full set of modules is RRegex - PCRE if available, else Posix, (compatable with Text.Regex) RRegex.PCRE- Perl compatable

RE: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread David Bergman
Gabriel wrote: > | This overloading by namespace is usually called either ADL > | (Argument-Dependent Lookup) or Koenig Lookup (especially in C++.) > > Actually in C++, it is called "argument dependent name > lookup", and that is the way the C++ definition text calls > it. As Andy Koenig has

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread oleg
Hello! > So, how can you come up with a type class which provides a polymorphic > 'add' function, considering you don't even know how many parameters > each data type's individual add function uses? Very easily: every Haskell function takes only one argument. Always. Ever. > For example, say I'

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread ozone
On 27/02/2004, at 1:13 PM, [EMAIL PROTECTED] wrote: For example, say I'm writing the Data.Complex module; there's a function in that module "phase :: RealFloat a => Complex a -> a". So, how do you put this phase function into a type class? Perhaps you could abstract away from the RealFloat and C

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread Brandon Michael Moore
On Fri, 27 Feb 2004 [EMAIL PROTECTED] wrote: > On 27/02/2004, at 1:13 PM, [EMAIL PROTECTED] wrote: > > 1) now I have to manually declare a class definition for every single > function, and I have to declare it in advance before any module defines > that function (most serious problem; see below),

Re: [Haskell] Per-type function namespaces (was: Data.Set whishes)

2004-02-26 Thread Gabriel Dos Reis
"David Bergman" <[EMAIL PROTECTED]> writes: | > The idea that I've been throwing around is to be able to define a | > separate namespace for each type; a function can either belong in a | > "global" (default) namespace, or belong in a particular type's | > namespace. So, in the above example,

RE: [Haskell] performance tuning Data.FiniteMap

2004-02-26 Thread Simon Peyton-Jones
| But in managing this tradeoff, what is faster: | * constructing/destructing e.g. 16 trees (for a 65000 item table) | * 2 memcpy of 256 item arrays (perhaps after you primop?) | | If the later is not dramatically slower than I | will bias towards more arrayness. I doubt the latter is dramatical

Re: [Haskell] Re: Data.Set whishes

2004-02-26 Thread Alastair Reid
> I have always wondered why the module system is not used at > all in these conventions. I mean, the function names seem to > come straight from the Haskell 1.2 days when there was no > module system! I used the module system in this way in the first version of the HGL (http://haskell.org/graph