Re: List of class instances?

1999-08-19 Thread Fergus Henderson
On 18-Aug-1999, Michael Hobbs <[EMAIL PROTECTED]> wrote: > What I would like to do is have a function that takes a list of > "objects", where the objects are all instances of a particular class, > but not necessarily the same type. Example: > > class Shape a where > extent :: a -> Point > ...

Re: Question

1999-08-19 Thread Marcin 'Qrczak' Kowalczyk
Fri, 20 Aug 1999 02:59:09 +1000, Bob Howard <[EMAIL PROTECTED]> pisze: > data BTree Integer = Leaf Integer | Node Integer (BTree Integer) (BTree Integer) Write either data BTree a = Leaf a | Node a (BTree a) (BTree a) or data BTree = Leaf Integer | Node Integer BTree BTree depending on what

Re: Question

1999-08-19 Thread Jon . Fairbairn
On 20 Aug, Bob Howard wrote: > data BTree Integer = Leaf Integer | Node Integer (BTree Integer) (BTree Integer) ^ this ought to be a type variable name, but you've put the name of a type. > mkTree :: Integer -> BTree ^ arg

Re: syntax

1999-08-19 Thread D. Tweed
On Fri, 20 Aug 1999, Bob Howard wrote: > data Tree a = Leaf a | Branch (Tree a) (Tree a) > Branch :: Tree a -> Tree a -> Tree a > Leaf :: a -> Tree a > > Im just learning haskell and I cant seem to figure out what is wrong with the above >code. > Im using Hugs98 as in interperator (sp) and I ke

RE: Question

1999-08-19 Thread Jan Skibinski
On Thu, 19 Aug 1999, S. Alexander Jacobson wrote: > Mark, > > Out of curiosity, how big is the user community? How many downloads of > the software? How many are on this list? If you figure that 1 user in > 1000 is actually going to contribute a useful change each month (that is > probably

seek help with overlapping instances

1999-08-19 Thread Marko Schuetz
I have something similar to > class (Eq a) => Substitutable a where > match :: a -> a -> Maybe (Substitution a) > applySubst :: Substitution a -> a -> a and two Types Type1, Type2, both of which are instances of class Substitutable. In some places there is a sigma :: Substitution Type1 (or a

propaganda 2: Fast, Multi Layout Pretty Printing Combinators

1999-08-19 Thread S. Doaitse Swierstra
,,Fast, Multi Layout Pretty Printing Combinators (Updated: Aug-19-1999) I have placed a completely new version of our parser combinators on the net at http://www.cs.uu.nl/groups/ST/Software/PP/ Why would you like to use these Combinators? Have you always been intrigued by Prett

propaganda 3: Advaced Functional Programming 3 Proceedings

1999-08-19 Thread S. Doaitse Swierstra
,,AFP3 Proceedings You may not have noticed, but Springer has published the proceedings of the AFP3: ,,@book{AFP3, author= {Doaitse Swierstra and Pedro Henriques and Jos\'{e} Oliveira}, title = {Advanced Functional Programming, Third International School

RE: Question

1999-08-19 Thread S. Alexander Jacobson
Mark, Out of curiosity, how big is the user community? How many downloads of the software? How many are on this list? If you figure that 1 user in 1000 is actually going to contribute a useful change each month (that is probably optimistic), the slow flow of changes isn't that surprising. A

Re: Adopted optional parameters solution.

1999-08-19 Thread Marko Schuetz
> "Marko" == Marko Schuetz <[EMAIL PROTECTED]> writes: > "Andy" == Andy Gill <[EMAIL PROTECTED]> writes: Andy> instance (HTML a) => HTML ([HtmlAttr] -> a) where Andy> html f = html (f []) Marko> Wouldn't >> instance (HTML b, MonadPlus a) => HTML (a -> b) where >> html f = html (f mzero

RE: Question

1999-08-19 Thread Mark P Jones
Hi Alex, | Out of curiosity, how big is the user community? How many downloads of | the software? How many are on this list? I don't know the answers to any of these, but I think you're implying "very small", and I'm sure you're right. Perhaps you're also suggesting that our community is too

Re: Licenses and Libraries

1999-08-19 Thread Erik Meijer
> Whatever happened to the auto-import of java classes? That's what I am supposed to be working on while Sigbjorn is enjoying the fjords. We have a nasty bug having to do with the (what we thought as) clever way of representing JNI objects in Haskell. There is an elegant solution using implici

Re: Question

1999-08-19 Thread Paul Hudak
> Ok my last post was a bit of a silly question on my behalf, but this > has be stumped. > > data BTree Integer > = Leaf Integer | Node Integer (BTree Integer) (BTree Integer) > mkTree :: Integer -> BTree > mkTree 0 = Leaf 0 > mkTree int = Node int (mkTree (int - 1)) (mkTree (int -1)) > >

Re: Licenses and Libraries

1999-08-19 Thread Erik Meijer
> And, as a practical step, writing libraries seems like > an excellent way to get involved --- especially if they're useable with > multiple implementations. I can reveal a little secret (Sigbjorn is far away in the Norwegian woods :-) namely that soon H/Direct will directly support .h files, w

Re: Question

1999-08-19 Thread Michael Hobbs
> Bob Howard wrote: > > Ok my last post was a bit of a silly question on my behalf, but this > has be stumped. > > data BTree Integer = Leaf Integer | Node Integer (BTree Integer) > (BTree Integer) > mkTree :: Integer -> BTree > mkTree 0 = Leaf 0 > mkTree int = Node int (mkTree (int - 1)) (mkTre

Re: Adopted optional parameters solution.

1999-08-19 Thread Marko Schuetz
> "Andy" == Andy Gill <[EMAIL PROTECTED]> writes: Andy> instance (HTML a) => HTML ([HtmlAttr] -> a) where Andy> html f = html (f []) Wouldn't > instance (HTML b, MonadPlus a) => HTML (a -> b) where > html f = html (f mzero) work as well? Marko -- Marko Schütz[EMAIL P

Re: List of class instances?

1999-08-19 Thread Marcin 'Qrczak' Kowalczyk
Thu, 19 Aug 1999 19:08:49 +1000, Fergus Henderson <[EMAIL PROTECTED]> pisze: > > The problem with this is that the caller of `biggest' needs to call > > `mkShape' on each element in the list before it can construct the list. > > Not _bad_, but rather unwieldy. The caller can't simply use `map' ei

RE: Question

1999-08-19 Thread Mark P Jones
| Actually, I have fond memories of Algol compilers that gave error | messages pretty much as comprehensible as those above. I guess the | problem is that Haskell compilers are prepared by people who have more | pressing tasks than repeating old work on user friendly error messages | :-( Jon's c

Haskell compiler not in Haskell?

1999-08-19 Thread S.D.Mechveliani
Do the Haskell compilers contain the parts written not in Haskell? -- Sergey Mechveliani [EMAIL PROTECTED]

RE: Question

1999-08-19 Thread Mark P Jones
| Ok my last post was a bit of a silly question on my behalf, but this | has be stumped. | | data BTree Integer = Leaf Integer | Node Integer (BTree Integer) (BTree Integer) | ... | can anyone tell me why I get this error when I compile this. | ERROR "Btree.hs" (line 2): Illegal left hand side i

RE: seek help with overlapping instances

1999-08-19 Thread Mark P Jones
Hi Marko, | I have something similar to | | > class (Eq a) => Substitutable a where | > match :: a -> a -> Maybe (Substitution a) | > applySubst :: Substitution a -> a -> a | | and two Types Type1, Type2, both of which are instances of class | Substitutable. ... but defining | | > instance S