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
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
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
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
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
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 []
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
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
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
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.
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
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,
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
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
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
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
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
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
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.
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
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
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
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
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:
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
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
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.
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
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
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
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!
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
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
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:
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
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
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
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,
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
39 matches
Mail list logo