[Haskell-cafe] Overlapping instances

2005-08-11 Thread Frank
I would like to state that a class Sup is exhaustively broken down in two subclasses Sub1 and Sub2 (meaning, for every instance of Sub1 and every instance of Sub2, the methods in Sup apply). I try to code this as: instance Sub1 x = Sup x instance Sub2 x = Sup x And get the (expected) error

Re: [Haskell-cafe] Creating a Haskell app to do crosstabs

2005-08-11 Thread Andy Elvey
Bulat Ziganshin wrote: snip btw, afaik Spirit is modeled after ParseC (parsing combinators) haskell library and Phoenix was needed for this library because parser combinators require lazy functional language to work :) Hi Bulat - thanks for this! I didn't know that about Phoenix.

Re: [Haskell-cafe] Creating a Haskell app to do crosstabs

2005-08-11 Thread Andy Elvey
Greg Buchholz wrote: Andy Elvey wrote: a) Using Haskell to read a delimited file (with column-headings) into a columnar or tabular data-structure - Parsec (http://www.cs.uu.nl/~daan/parsec.html) is a great parsing library in Haskell. Greg Buchholz Hi Greg - thanks very

[Haskell-cafe] Re: Creating a Haskell app to do crosstabs

2005-08-11 Thread Peter Simons
Bulat Ziganshin writes: afaik Spirit is modeled after ParseC (parsing combinators) haskell library and Phoenix was needed for this library because parser combinators require lazy functional language to work :) Just a minor nit: the Phoenix library has nothing to do with parsing. It's

RE: [Haskell-cafe] Functional dependenices in class declarations

2005-08-11 Thread Simon Peyton-Jones
It's intentional. Consider this data type declaration data B b = MkT (A a b) Should that be accepted? The only thing it could possibly mean would be data B b = MkT (forall a. A a b) and I suppose that might possibly be useful. But in this case you're also saying that a

RE: [Haskell-cafe] Functional dependencies and type inference

2005-08-11 Thread Simon Peyton-Jones
Einar Good question. This is a more subtle form of the same problem as I described in my last message. In fact, it's what Martin Sulzmann calls the critical example. Here is a boiled down version, much simpler to understand. module Proxy where class Dep a b | a - b

[Haskell-cafe] Re: [Haskell] pros and cons of static typing and side effects ?

2005-08-11 Thread Mark Carroll
The previous comments make sense to me. The lots-of-unit-tests aspect of static typing I find really useful, far exceeding any BDSM cost. If I'm engaging in exploratory programming, the type inference combined with the ability to write 'error armadillo' in stubs for values I can't be bothered to

Re: [Haskell-cafe] Re: Creating a Haskell app to do crosstabs

2005-08-11 Thread Bulat Ziganshin
Hello Peter, Thursday, August 11, 2005, 1:18:54 PM, you wrote: PS afaik Spirit is modeled after ParseC (parsing combinators) PS haskell library and Phoenix was needed for this library PS because parser combinators require lazy functional language to PS work :) PS Just a minor nit: the

Re: [Haskell-cafe] Functional dependencies and type inference

2005-08-11 Thread Iavor Diatchki
Hello, On 8/11/05, Simon Peyton-Jones [EMAIL PROTECTED] wrote: ... Here is a boiled down version, much simpler to understand. module Proxy where class Dep a b | a - b instance Dep Char Bool foo :: forall a. a - (forall b. Dep a b = a - b) - Int