[Haskell-cafe] Problem with fundeps.

2005-01-03 Thread oleg
On Sun, 2 Jan 2005 [EMAIL PROTECTED] wrote: > I tried to generalize one of my old > packages for quantum *abstract* computations, where state vectors are > defined as functional objects, whose codomain has some arithmetic. > It is easy to see that you can define (f <+> g) = \x -> f x + g x > etc.

[Haskell-cafe] Re: Typed Lambda-Expressions withOUT GADTs

2005-01-03 Thread oleg
Conor McBride has pointed out a really interesting issue with macro-expressing GADT in typeclasses, outlined in the previous message. Suppose we have a GADT "OpenExpression env r" for lambda-expressions, and we define newtype Expression r = MkExpression (forall env. OpenExpression env r) to ab

Re: [Haskell-cafe] Re: Typed Lambda-Expressions withOUT GADTs

2005-01-03 Thread ajb
G'day all. Quoting Conor McBride <[EMAIL PROTECTED]>: > Where now? Well, counterexample fiends who want to provoke Oleg into > inventing a new recipe had better write down a higher-order example. > I just did, then deleted it. Discretion is the better part of valour. Thankfully, I'm the sort of

[Haskell-cafe] Re: GHC for .NET?

2005-01-03 Thread Ashley Yakeley
In article <[EMAIL PROTECTED] ft.com>, "Don Syme" <[EMAIL PROTECTED]> wrote: > We still frequently talk about doing either Haskell.NET or a strict > language much closer to Haskell (perhaps as a stepping stone to doing > Haskell). But neither are currently active projects. I've heard complaint

RE: [Haskell-cafe] GHC for .NET?

2005-01-03 Thread Don Syme
That's out of date - I abandoned my first effort to do ghc.net in favour of doing a strict functional language first - F# is the result (http://research.microsoft.com/projects/fsharp). We still frequently talk about doing either Haskell.NET or a strict language much closer to Haskell (perhaps as

Re: [Haskell-cafe] ReadS with Maybe

2005-01-03 Thread Robert Dockins
From the GHC docs: type ReadS a = String -> [(a, String)] A parser for a type a, represented as a function that takes a String and returns a list of possible parses (a,String) pairs. So it returns all possible parses, hence the list. This is useful if the encoding is ambiguous. Henning Thielem

[Haskell-cafe] ReadS with Maybe

2005-01-03 Thread Henning Thielemann
What is the reason for the definition ReadS a = [(a, String)] not being ReadS a = Maybe (a, String) ? The latter one reflects that either one or no value is read, whereas the first definition allows an arbitrary number of read values which is confusing and unsafe in my opinion.

Re: [Haskell-cafe] lazy readFile

2005-01-03 Thread David Sabel
Hi! I'm also interested, how to get this example working: http://www.haskell.org/pipermail/haskell/2001-November/008336.html This seems to be an old discussion: http://www.haskell.org/pipermail/libraries/2001-April/000358.html Was a strictReadFile implemented in the meantime? Here's my implemen

[Haskell-cafe] Hassoal

2005-01-03 Thread Henning Thielemann
Does someone know more about the Haskell interface to the Structured Audio Orchestra Language as presented at http://sourceforge.net/projects/hassoal/ ? I was not able to contact the author. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org htt

[Haskell-cafe] lazy readFile

2005-01-03 Thread Henning Thielemann
I'm also interested, how to get this example working: http://www.haskell.org/pipermail/haskell/2001-November/008336.html This seems to be an old discussion: http://www.haskell.org/pipermail/libraries/2001-April/000358.html Was a strictReadFile implemented in the meantime? ___

Re: [Haskell-cafe] Re: Typed Lambda-Expressions withOUT GADTs

2005-01-03 Thread Keean Schupke
Conor, I thought you might like this... It shows how to do this without phantom types! (we just use scoped type variables to help the typechecker sort things out)... What do you think? Does this overcome all the problems with Olegs approach? (the only slight problem I have found is that you

Re: [Haskell-cafe] Problem with fundeps.

2005-01-03 Thread Jerzy Karczmarczuk
Henning Thielemann cites myself I am afraid that something is wrong with my understanding of multi- param classes with dependencies. I tried to generalize one of my old packages for quantum *abstract* computations, where state vectors are defined as functional objects,... class Vspace a v | v -> a

Re: [Haskell-cafe] Re: Typed Lambda-Expressions withOUT GADTs

2005-01-03 Thread Conor McBride
Hi again Actually, things are a little weirder than I first thought... Me: The latter also means that the existential type encoding of 'some good term' doesn't give you a runnable term. There is thus no useful future-proof way of reflecting back from the type level to the term level. Any existentia

Re: [Haskell-cafe] Problem with fundeps.

2005-01-03 Thread Henning Thielemann
On Sun, 2 Jan 2005 [EMAIL PROTECTED] wrote: > I am afraid that something is wrong with my understanding of multi- > param classes with dependencies. I tried to generalize one of my old > packages for quantum *abstract* computations, where state vectors are > defined as functional objects, whose c

Re: [Haskell-cafe] Re: Problem with fundeps.

2005-01-03 Thread Keean Schupke
I would suggest defining types for unit and functions... data Scalar a = Scalar a data Function c v = Function c v instance VSpace a (Scalar a) ... -- replaces 'a' instance VSpace a (Function c a) ... -- replaces c -> a instance VSpace a v => a (Function c v) ... -- replaces c -> v Here Scalar is j

Re: [Haskell-cafe] Associative array updating

2005-01-03 Thread Cale Gibbard
Hello again, Actually ran the original code (on the same file, still using gnome-terminal). I noticed that it sped up as it went along, so it didn't actually take quite as much time as I originally thought it might. real 13m5.190s user6m1.595s sys 0m3.061s By the way, the finitemap code

Re: [Haskell-cafe] Associative array updating

2005-01-03 Thread Cale Gibbard
Hello, I found the following implementation using finite maps to work rather well. (See http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.FiniteMap.html) --- import Char import Data.FiniteMap isLetter c = isAlphaNum c || c=='\'' normalize = map toLower . filter isL