[Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Martin Hofmann
It is pretty clear, that the following is not a valid Haskell pattern: foo (x:x:xs) = x:xs My questions is _why_ this is not allowed. IMHO, the semantics should be clear: The pattern is expected to succeed, iff 'x' is each time bound to the same term. Isn't this allowed, because this would

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Miguel Mitrofanov
What would you expect foo [id, \x - x] to be? Martin Hofmann wrote on 15.05.2009 12:09: It is pretty clear, that the following is not a valid Haskell pattern: foo (x:x:xs) = x:xs My questions is _why_ this is not allowed. IMHO, the semantics should be clear: The pattern is expected to

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Janis Voigtlaender
Martin Hofmann wrote: It is pretty clear, that the following is not a valid Haskell pattern: foo (x:x:xs) = x:xs My questions is _why_ this is not allowed. IMHO, the semantics should be clear: The pattern is expected to succeed, iff 'x' is each time bound to the same term. Isn't this

RE: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Sittampalam, Ganesh
Martin Hofmann wrote: It is pretty clear, that the following is not a valid Haskell pattern: foo (x:x:xs) = x:xs My questions is _why_ this is not allowed. IMHO, the semantics should be clear: The pattern is expected to succeed, iff 'x' is each time bound to the same term. How do you

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Salvador Lucas
Dear Martin, I think that the (practical) reason is avoiding equality checks during pattern matching. For instance, how do you evaluate this: foo ((+1):(1+):[])? Both expressions in the first and second entries of the list are semantically equivalent, but from an operational point of

Re: [Haskell-cafe] Pretty printing a tree

2009-05-15 Thread wren ng thornton
José Romildo Malaquias wrote: Hello. I would like to pretty print a tree in a way that its structure is easily perceived. For instance, consider the declarations: data Node a = Node a [Node a] type Tree a = [ Node a ] t = [ Node a [ Node b [] , Node c [ Node c1 []

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Eugene Kirpichov
Why, then, not permit such definitions only for members of Eq? My thoughts: - because it will break an important invariant indicated by Martin, namely the one that says that pattern variables are not forced - it will make efficient compilation of pattern matching much harder - it will make the

Re: [Haskell-cafe] I have forgotten .. my bad

2009-05-15 Thread Dougal Stanton
On Fri, May 15, 2009 at 5:30 AM, Vasili I. Galchin vigalc...@gmail.com wrote: Hello,    darcs get --init ?? I want to pull down Data.FiniteMap. I have forgotten the path to Hackage .. I tried  sudo darcs get http://hackage.haskell.org/ Data.FiniteMap [sudo] password for

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Conor McBride
Hi On 15 May 2009, at 09:11, Sittampalam, Ganesh wrote: Martin Hofmann wrote: It is pretty clear, that the following is not a valid Haskell pattern: foo (x:x:xs) = x:xs My questions is _why_ this is not allowed. IMHO, the semantics should be clear: The pattern is expected to succeed, iff

[Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-15 Thread John Lato
leimy2k: On Thu, May 14, 2009 at 8:46 PM, Don Stewart d...@galois.com wrote: leimy2k: On Thu, May 14, 2009 at 8:40 PM, Don Stewart d...@galois.com wrote:     leimy2k:     I actually need little endian encoding... wondering if anyone else hit     this     with Data.Binary.

Re: [Haskell-cafe] I have forgotten .. my bad

2009-05-15 Thread Jason Dagit
On Thu, May 14, 2009 at 9:30 PM, Vasili I. Galchin vigalc...@gmail.com wrote: Hello,    darcs get --init ?? I want to pull down Data.FiniteMap. I have forgotten the path to Hackage .. I tried  sudo darcs get http://hackage.haskell.org/ Data.FiniteMap [sudo] password for

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread wren ng thornton
Conor McBride wrote: Hi Sittampalam, Ganesh wrote: Martin Hofmann wrote: It is pretty clear, that the following is not a valid Haskell pattern: foo (x:x:xs) = x:xs My questions is _why_ this is not allowed. IMHO, the semantics should be clear: The pattern is expected to succeed,

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Claus Reinke
I miss lots of stuff from when I was a kid. I used to write elem x (_ ++ x : _) = True elem _ _ = False and think that was cool. How dumb was I? Yeah, the Kiel Reduction Language had similarly expressive and fun pattern matching, with subsequence matching and backtracking if

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-15 Thread Duncan Coutts
On Thu, 2009-05-14 at 20:46 -0700, David Leimbach wrote: On Thu, May 14, 2009 at 8:40 PM, Don Stewart d...@galois.com wrote: leimy2k: I actually need little endian encoding... wondering if anyone else hit this with Data.Binary. (because I'm

RE: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Sittampalam, Ganesh
Conor McBride wrote: On 15 May 2009, at 09:11, Sittampalam, Ganesh wrote: but then pattern matching can introduce Eq constraints which some might see as a bit odd. Doesn't seem that odd to me. Plenty of other language features come with constraints attached. It's the introduction of a

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Lennart Augustsson
In the original language design the Haskell committee considered allowing multiple occurrences of the same variable in a pattern (with the suggested equality tests), but it was rejected in favour of simplicity. -- Lennart On Fri, May 15, 2009 at 11:30 AM, Sittampalam, Ganesh

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Conor McBride
On 15 May 2009, at 12:07, Lennart Augustsson wrote: In the original language design the Haskell committee considered allowing multiple occurrences of the same variable in a pattern (with the suggested equality tests), but it was rejected in favour of simplicity. Simplicity for whom, is the

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Miguel Mitrofanov
Conor McBride wrote on 15.05.2009 16:19: My guess is that if this feature were already in, few would be campaigning to remove it. You're probably right. For example, I'm not compaigning to remove multiple inheritance (from non-abstract classes) from C++. But I still think it's an ugly

Re: [Haskell-cafe] Pretty printing a tree

2009-05-15 Thread Matthias Görgens
Hello, Or --- if you just want pretty trees and you are not confined to the command line: You can generate GraphViz code and use that program to draw your tree in PostScript. (There is also a GraphViz-package, but generating the code yourself is easy.) Matthias.

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Lennart Augustsson
Simplicity of pattern matching semantics, not of implementation (we all knew how to implement it). Miranda had non-linear patterns, but nobody really argued for them in Haskell. If Haskell had them, I'd not argue to have them removed, but nor will I argue to add them. -- Lennart On Fri, May

[Haskell-cafe] Problem with haddock importing definition

2009-05-15 Thread Maurício
Hi, I have a situation like this: module A imports R (a newtype declaration) from module B, and lists it in its (module A) export list. Documentation for R is included by haddock in documentation for module A, as I want. However, if my package exposes only module A, documentation for R

[Haskell-cafe] #haskell.pt IRC channel

2009-05-15 Thread Marco Túlio Gontijo e Silva
Hello, I'd like to invite all Portuguese speakers haskellers to join #haskell.pt in irc.freenode.net. I added it to the list in http://www.haskell.org/haskellwiki/IRC_channel . Greetings. -- marcot http://marcot.iaaeee.org/ ___ Haskell-Cafe mailing

[Haskell-cafe] ICFP09 Accepted Papers

2009-05-15 Thread Matthew Fluet (ICFP Publicity Chair)
Accepted Papers ICFP 2009: International Conference on Functional Programming Edinburgh, Scotland, 31 August - 2 September 2009 http://www.cs.nott.ac.uk/~gmh/icfp09.html The ICFP 2009 Program Chair and Committee are pleased to announce that

Re: [Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-15 Thread David Leimbach
This approach looks like it'd work just fine. On Fri, May 15, 2009 at 2:16 AM, John Lato jwl...@gmail.com wrote: leimy2k: On Thu, May 14, 2009 at 8:46 PM, Don Stewart d...@galois.com wrote: leimy2k: On Thu, May 14, 2009 at 8:40 PM, Don Stewart d...@galois.com wrote:

[Haskell-cafe] TFM09: Last CFP (Formal Methods Week, Eindhoven, November 6th 2009)

2009-05-15 Thread J.N. Oliveira
TFM2009 2nd Int. FME Conference on Teaching Formal Methods Widening Access to Formal Methods Friday, November 6th 2009, co-located with FM2009 : 16th International Symposium

Re: [Haskell-cafe] I have forgotten .. my bad

2009-05-15 Thread Vasili I. Galchin
I mean what is the path to Hackage repo? Vasili On Fri, May 15, 2009 at 4:32 AM, Jason Dagit da...@codersbase.com wrote: On Thu, May 14, 2009 at 9:30 PM, Vasili I. Galchin vigalc...@gmail.com wrote: Hello, darcs get --init ?? I want to pull down Data.FiniteMap. I have

[Haskell-cafe] Re: I have forgotten .. my bad

2009-05-15 Thread Benedikt Huber
Vasili I. Galchin schrieb: Hello, darcs get --init ?? I want to pull down Data.FiniteMap. I have forgotten the path to Hackage .. I tried Hi Vasili, Hackage does not host the darcs repositories. You can get the FinitMap's source code via cabal unpack FiniteMap though.

[Haskell-cafe] Don't play with your monads...

2009-05-15 Thread David Leimbach
eventually you'll go bind. Sorry couldn't resist. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Don't play with your monads...

2009-05-15 Thread Ertugrul Soeylemez
David Leimbach leim...@gmail.com wrote: eventually you'll go bind. Sorry couldn't resist. I'd rather go pure joyn. Greets, Ertugrul. -- nightmare = unsafePerformIO (getWrongWife = sex) http://blog.ertes.de/ ___ Haskell-Cafe mailing list

[Haskell-cafe] ANN: RESTng 0.1 + RedHandlers 0.1 (request handlers) + YuiGrids 0.1 (yahoo grids)

2009-05-15 Thread Sergio Urinovsky
I'd like to announce the release of 3 new packages in hackage developed for a RESTful web framework called RESTng. They are experimental, the framework is incomplete and we are currently not actively developing it. There are several interesting features so we have decided to release them to share

Re: [Haskell-cafe] GSoC project for EclipseFP

2009-05-15 Thread Henning Thielemann
On Thu, 14 May 2009, Thomas ten Cate wrote: I'm happy to announce that my Google Summer of Code project proposal, titled Extend EclipseFP functionality for Haskell, has been accepted! This means that I will be working on EclipseFP during the upcoming months. Great news!

[Haskell-cafe] Example code won't compile

2009-05-15 Thread michael rice
Why won't this code compile? Michael === {- Author: Jeff Newbern    Maintainer: Jeff Newbern jnewb...@nomaware.com    Time-stamp: Thu Aug 14 09:53:53 2003    License:    GPL -} {- DESCRIPTION Example 14 - Using the IO monad Usage: Compile the code to produce a poor

Re: [Haskell-cafe] Example code won't compile

2009-05-15 Thread Don Stewart
nowgate: Why won't this code compile? [mich...@localhost ~]$ ghc ex14.hs -o ex14 Missing --make I'd also add -O2, but I'm like that. -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Example code won't compile

2009-05-15 Thread michael rice
This example compiles fine without --make. What's the difference? Michael == {- Author: Jeff Newbern    Maintainer: Jeff Newbern jnewb...@nomaware.com    Time-stamp: Wed Jul  2 18:11:36 2003    License:    GPL -} {- DESCRIPTION Example 13 - Using the List monad Usage:

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread wren ng thornton
Conor McBride wrote: Rumblings about funny termination behaviour, equality for functions, and the complexity of unification (which isn't the proposal anyway) But unification is what you get by adding non-linearity. Sure, all terms are ground; would you prefer I said testing for membership in

Re: [Haskell-cafe] Example code won't compile

2009-05-15 Thread Krzysztof Skrzętnicki
The one important line is import Control.Monad.Error It adds dependancy on mtl package, which is not used by default (contrary to 'base' package, which includes Monad, System and IO modules). With --make GHC adds it automatically. Therefore $ ghc -package mtl ex14.hs compiles fine. I'd recommend

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Jason Dusek
Algebraic datatypes are built and unpacked with constructors. Pattern matching is just a way to use these constructors. This is distinct from the kind of unification/validation that happens in logic languages like Prolog. There is no special list constructor for when the first two items

Re: [Haskell-cafe] Example code won't compile

2009-05-15 Thread michael rice
OK. Thanks, everyone. Michael --- On Fri, 5/15/09, Krzysztof Skrzętnicki gte...@gmail.com wrote: From: Krzysztof Skrzętnicki gte...@gmail.com Subject: Re: [Haskell-cafe] Example code won't compile To: michael rice nowg...@yahoo.com Cc: Lennart Augustsson lennart.augusts...@gmail.com,

[Haskell-cafe] Data.FiniteMap deprecrated

2009-05-15 Thread Vasili I. Galchin
Hello, http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FiniteMap ... since this is deprecated what is the orthodox way to implement finite map?? Thanks, Vasili ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org