Re: [Haskell-cafe] Features of Haskell

2006-06-09 Thread Tracy R Reed
Jared Updike wrote: I was always impressed with Autrijus Tang's presentation here: http://www.pugscode.org/euroscon/haskell.xul (view with Firefox or other Gecko-based browser) Unfortunately, this presentation alone is incomprehensible to someone who does not know Haskell. I suspect

RE: [Haskell-cafe] Re: Editors for Haskell

2006-06-09 Thread Simon Peyton-Jones
GHC already carefully collects up almost all messages in a data type called Message, so they are easy to re-direct. However at the moment they collected as strings (well as Pretty.Doc values actually) so they have lost their structure. I believe that at one time I had a data type for error

Re: [Haskell-cafe] Features of Haskell

2006-06-09 Thread Clifford Beshers
Tracy R Reed wrote: Jared Updike wrote: I was always impressed with Autrijus Tang's presentation here: http://www.pugscode.org/euroscon/haskell.xul (view with Firefox or other Gecko-based browser) Unfortunately, this presentation alone is incomprehensible to

[Haskell-cafe] Literate Haskell in Vim - a bug and a workaround (?)

2006-06-09 Thread Piotr Kalinowski
Hi, I've been recently playing with literate haskell in latex mode in Vim. The versions are: Vim - 6.4.6 tex.vim - 30 lhaskell.vim - 1.01 I encountered a bug. If you put \section (or \subsection or \chapter or other similar command), haskell syntax highlighting is lost from this command

[Haskell-cafe] Cabal and linking with static libs (.a files)

2006-06-09 Thread Ketil Malde
(Reposted to café - my -libraries mail seems to have gotten lost along the way) Hi, I'm building an interface to a C library, which comes in the form of two .a files. I can't seem to get Cabal to link statically with these, so that the resulting package (libHSfoo-v.v.a) is self contained.

[Haskell-cafe] Newbie request

2006-06-09 Thread Geevarghese Philip
I am trying to learn Haskell. As an exercise, I wrote a function to create a binary tree in level-order. I am attaching the code. I am sure there are a number of places where the code could be improved. Could you please point these out? Thanks, Philip

Re: [Haskell-cafe] Newbie request

2006-06-09 Thread Donald Bruce Stewart
gphilip.newsgroups: I am trying to learn Haskell. As an exercise, I wrote a function to create a binary tree in level-order. I am attaching the code. I am sure there are a number of places where the code could be improved. Could you please point these out? There's a highly efficient example

[Haskell-cafe] Re: Cabal and linking with static libs (.a files)

2006-06-09 Thread Simon Marlow
Ketil Malde wrote: (Reposted to café - my -libraries mail seems to have gotten lost along the way) I'm building an interface to a C library, which comes in the form of two .a files. I can't seem to get Cabal to link statically with these, so that the resulting package (libHSfoo-v.v.a) is

Re: [Haskell-cafe] Newbie request

2006-06-09 Thread Bertram Felgenhauer
Geevarghese Philip wrote: I am trying to learn Haskell. As an exercise, I wrote a function to create a binary tree in level-order. I am attaching the code. I am sure there are a number of places where the code could be improved. Could you please point these out? I'll try. Thanks, Philip

[Haskell-cafe] newbie type signature question

2006-06-09 Thread Brock Peabody
Please excuse my newbiness, but in this snippet: data (Monad m) = DataType m = DataType { f :: Char - m () } test_function :: (Monad m) = DataType m - m () test_function d = f d 'C' Why is (Monad m) = required, when the definition

[Haskell-cafe] Re: Newbie request

2006-06-09 Thread Geevarghese Philip
Hi Bertram, Don, Thanks for your patience with my toy code. Your analyses helped me a lot. Thanks, Philip On Fri, 09 Jun 2006 02:27:01 +0500, Geevarghese Philip wrote: I am trying to learn Haskell. As an exercise, I wrote a function to create a binary tree in level-order. I am

[Haskell-cafe] Re: Newbie request

2006-06-09 Thread Chad Scherrer
Philip,you wrote:-I am trying to learn Haskell. As an exercise, I wrote afunction to create a binary tree in level-order. I am attaching the code. I am sure there are a number of places wherethe code could be

Re: [Haskell-cafe] newbie type signature question

2006-06-09 Thread Brian Hulley
Brock Peabody wrote: Please excuse my newbiness, but in this snippet: data (Monad m) = DataType m = DataType { f :: Char - m () } test_function :: (Monad m) = DataType m - m () test_function d = f d 'C' Why is (Monad m) = required, when the definition

RE: [Haskell-cafe] newbie type signature question

2006-06-09 Thread Brock Peabody
Brian Hulley wrote: There was a post a while back (unfortunately I can't seem to locate it) where someone posted a link to some guidelines on haskell coding style where one guideline was never to use contexts in data declarations. I would love to see that guideline. What is the correct way

RE: [Haskell-cafe] newbie type signature question

2006-06-09 Thread Brock Peabody
From: Brandon Moore Getting them both is tricky, but you can do it if you use a GADT to write a type that means exists a such that a = m and a is a Monad: Is GADT a way to assemble types at compile-time? It looks really cool. {-# OPTIONS -fglasgow-exts #-} data TyEq (a :: * - *) (b :: * -

Re: [Haskell-cafe] newbie type signature question

2006-06-09 Thread Brandon Moore
Sorry, I meant to send this to the whole list. Brock Peabody wrote: Please excuse my newbiness, but in this snippet: data (Monad m) = DataType m = DataType { f :: Char - m () } test_function :: (Monad m) = DataType m - m ()

[Haskell-cafe] Inferring types from functional dependencies

2006-06-09 Thread Jeff . Harper
The following message is in a Haskell module. It will be easier to read in a fixed point font. {-# OPTIONS -fglasgow-exts #-} -- Hi, -- -- I ran into an issue while working with functional dependencies. -- Consider the following code. I'm rewriting many of the prelude -- operators using

Re: [Haskell-cafe] Features of Haskell

2006-06-09 Thread John Meacham
ramble On Fri, Jun 09, 2006 at 02:16:47AM -0700, Clifford Beshers wrote: Interesting. I just gave a talk to the SGVLUG (San Gabriel Valley Linux Users Group, which is centered at Cal Tech). It was the first time I've given such a talk, half about Linspire/Freespire, half about Haskell

Re: [Haskell-cafe] Features of Haskell

2006-06-09 Thread Clifford Beshers
John Meacham wrote: ramble On Fri, Jun 09, 2006 at 02:16:47AM -0700, Clifford Beshers wrote: Interesting. I just gave a talk to the SGVLUG (San Gabriel Valley Linux Users Group, which is centered at Cal Tech). It was the first time I've given such a talk, half about

[Haskell-cafe] Inferred type not most general?

2006-06-09 Thread Greg Buchholz
I'm curious about a type inference oddity. In the code below, if I leave off the type signature for tmap, both GHC and Hugs infer that tmap has type... tmap :: (b - a, b - a) - Twist b b - Twist a a ...I'm wondering why they couldn't infer the more general... tmap :: (a - b, c -

Re[2]: [Haskell-cafe] newbie type signature question

2006-06-09 Thread Bulat Ziganshin
Hello Brian, Friday, June 9, 2006, 9:50:30 PM, you wrote: data (Monad m) = DataType m = DataType { f :: Char - m () } test_function :: (Monad m) = DataType m - m () There was a post a while back (unfortunately I can't seem to locate it) where someone