| Will I run into problems using typeclasses with GADTs?
No, you shouldn't, provided you use the HEAD compiler. I did a fairly major
upgrade, after the 6.6 fork, which makes the interaction between type classes
and GADTs work properly. This upgrade isn't in 6.6, and I regard the
Friends
I have agreed to give a 3-hr tutorial on Haskell at the Open Source Convention
2007
http://conferences.oreillynet.com/os2007/
I'm quite excited about this: it is a great opportunity to expose Haskell to a
bunch of smart folk, many of whom won't know much about Haskell. My
The following code has ambiguity, but I can't figure out how to get
around it. Am I missing something trivial? Am I going in the wrong
direction? Thank you in advance for your time and for any help that
you can offer.
data MehQueue = MehQueue
class MehBase a where new :: IO a
instance
What about demonstrating the use of an Haskell interpreter as a pimped up
calculator?
multTable = putStr $ unlines [unlines [show x ++ ' ':show y ++ ' ':show
(x*y)|y-[1..10]] | x-[1..10]]
2007/4/16, Simon Peyton-Jones [EMAIL PROTECTED]:
Friends
I have agreed to give a 3-hr tutorial on
Give them a program that selects a bunch of files based on some
filtering criteria, and then does something to each file.
Kind of like find + xargs, but using haskell instead. Good recipe for sysadmins.
There was a recent example involving parsing raw emails into a thread here
On 16/04/07, Thomas Hartman [EMAIL PROTECTED] wrote:
Maybe that could be simplified and something could be based on that.
A one-liner using PCRE regex might also be of use.
Unless it can be performed with astounding dexterity, I don't think
try to beat, for example, Perl at its own game
Yitz writes (in the Haskell Cafe):
This gives O(log k * (n + k)) execution in constant memory.
I guess that should be O(k) memory.
Cheers,
Ronny Wichers Schreur
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Mon, 2007-04-16 at 10:08 +, Arthur van Leeuwen wrote:
Goody! UU.PPrint is now on hackage! Regrettably, this does seem like
a bit of a waste of time, as UU.PPrint was already cabalised as part
of the Haskell Utrecht Tools at http://www.cs.uu.nl/wiki/HUT/
which also contains the parser
On 4/16/07, Paul Wankadia [EMAIL PROTECTED] wrote:
The following code has ambiguity, but I can't figure out how to get
around it. Am I missing something trivial? Am I going in the wrong
direction? Thank you in advance for your time and for any help that
you can offer.
How about changing
x
Hi!
On 4/16/07, Bertram Felgenhauer [EMAIL PROTECTED] wrote:
Since all the threads block on a single MVar how do they run in
parallel?
The idea is that before the threads block on the MVar, they run their
action x to completion.
The rendering crashes. I will have to precompute the values
On 16/04/2007, at 12:30, Mitar wrote:
Hi!
On 4/16/07, Bertram Felgenhauer
[EMAIL PROTECTED] wrote:
Since all the threads block on a single MVar how do they run in
parallel?
The idea is that before the threads block on the MVar, they run their
action x to completion.
The rendering
There may be something to this point of view.
On the other hand, it is easier for me to see examples that can
connect back to something I am already familiar with.
That said, I will mention something where perl *seemed* to be a fit,
but later proved frustrating. To whit -- Doing something at
Well, given that concurrency is a hot topic at the moment, how about
something based on STM?
E.g. perhaps some kind of instant messaging server? Or Twitter except
scalable. By ruthlessly eliminating features, you could get the core of
one of these down to something that could be built in three
On Mon, 2007-04-16 at 13:27 +0200, Thomas Hartman wrote:
To recap: transform a piece of simple code that works in serial, so it
works in parallel. Maybe even a couple, or three ways: using forks,
using threads, using map reduce.
This made me think of one of my favorite observations.
You
With regards to the variable interpolation in strings problem, it's
probably worth watching
http://groups.google.de/group/fa.haskell/browse_thread/thread/34741c2a5c311a17/286dbd62748ef1c1?lnk=stq=%22haskell+cafe%22+%22template+system%22rnum=1hl=en#286dbd62748ef1c1
which mentions some
Felipe Almeida Lessa [EMAIL PROTECTED] wrote:
How about changing
x - new
to
x - new :: IO MehQueue
?
Is it impossible for the compiler to infer the type from the methods called?
(-fweird-strange-sick-twisted-eerie-godless-evil-stuff!-and-i-want-in.)
On Mon, 2007-04-16 at 11:06 +0100, Dougal Stanton wrote:
A one-liner using PCRE regex might also be of use.
Unless it can be performed with astounding dexterity, I don't think
try to beat, for example, Perl at its own game will produce worthwhile
results.
One possibility is a task where
On 4/16/07, Ketil Malde [EMAIL PROTECTED] wrote:
On Mon, 2007-04-16 at 13:27 +0200, Thomas Hartman wrote:
To recap: transform a piece of simple code that works in serial, so it
works in parallel. Maybe even a couple, or three ways: using forks,
using threads, using map reduce.
This made me
Hi,
I'm looking for a type class which checks whether two types are the
same or not. My first guess is:
class Same a b where
same :: a - b - Bool
instance Same a a where
same _ _ = True
instance Same a b where
same _ _ = False
In Hugs this seems to work with overlapping instances (not
On Mon, 2007-04-16 at 09:34 +0100, Simon Peyton-Jones wrote:
Friends
I have agreed to give a 3-hr tutorial on Haskell at the Open Source
Convention 2007
http://conferences.oreillynet.com/os2007/
I'm quite excited about this: it is a great opportunity to expose Haskell to
a
Hi
I think its important to cover whats different about Haskell. Things
like laziness are cool, but are harder to convince a strict programmer
that they are useful. Types however are obviously very handy, if you
can focus on why a Haskell program is so obviously correct easily.
1) the type
Hi,
I saw that it's possible to peal off kinds from the right-hand side when
instantiating classes. Is it possible to peel them off from the left-hand
side? Or in any order?
I have been told in #haskell by people who seems to know that Very Bad Things
happen if you do this without also making
With regards to the variable interpolation in strings problem, ..
as i mentioned, it is not difficult to hack something up, and in many cases,
efficiency doesn't matter much for this part of the problem (though a standard,
efficient, well-designed library would be welcome). but if we compare
Hans van Thiel wrote:
On Mon, 2007-04-16 at 09:34 +0100, Simon Peyton-Jones wrote:
Friends
I have agreed to give a 3-hr tutorial on Haskell at the Open Source Convention
2007
http://conferences.oreillynet.com/os2007/
I'm quite excited about this: it is a great opportunity to expose
One technique I find compelling is (ab)using the type class system for
meta programming. Something from Lightweight Static Resources, Faking
It, or Hinze's Full Circle slides might be really attractive. Perhaps
Danvy's Haskell printf? The hook might be:
Yeah, you've heard of strong static typing
I put this on the haskell wiki at
http://haskell.org/haskellwiki/Poor_Man%27s_Heredoc_in_Haskell
So far I have only linked this from
http://haskell.org/haskellwiki/Simple_unix_tools
I feel like the wiki deserves a section on Haskell Template
Solutions distinct from this. However, there is a
Simon,
Hopefully a video of this tutorial would be made available as a learning
resource for those of use who can't make it to this Convention.
Troy
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Simon
Peyton-Jones
Sent: Monday, April 16, 2007 4:34
Hi,
I've recently stumbled upon some issues with the System.Random module,
and thought I'd try to remedy them. However, I'm not quite sure what an
optimal resolution is.
Problem 1 is that I often get the same random number on consecutive
program runs [1]. Looking at the code for initialization
Hopefully! Do suggest it to the OSCON organisers: the one I'm in touch with is
Vee McMillen [EMAIL PROTECTED]
Simon
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
| Taillefer, Troy (EXP)
| Sent: 16 April 2007 15:08
| To: Simon Peyton-Jones;
No we don't! At least not anywhere near as much of an exaggeration as that
statement would be about an strongly typed imperative language (sequencing
can't be type checked*, imperative programs are mostly sequencing, thus
imperative programs are mostly unchecked).
Actually, side effects *can*
Neil Mitchell [EMAIL PROTECTED] writes:
(snip)
I think its important to cover whats different about Haskell. Things
like laziness are cool, but are harder to convince a strict programmer
that they are useful.
(snip)
Mmmm, it took me a while to really find laziness useful, and that was
normally
Simon Peyton-Jones wrote:
I have agreed to give a 3-hr tutorial on Haskell at the Open Source
Convention 2007
http://conferences.oreillynet.com/os2007/
I'm quite excited about this: it is a great opportunity to expose Haskell to
a bunch of smart folk,
many of whom won't know much
Hi all. I am new to this list ;) Today I have encountered something new that
has never happened to me in the past 6 months that I have been using ghci
and Haskell.
I wrote this function:
type Line = (Point,Point)
type Point = (Float,Float)
circleLineIntersection :: Float - Float - Float -
On Mon, 16 Apr 2007, Gaetano Caruana wrote:
Hi all. I am new to this list ;) Today I have encountered something new that
has never happened to me in the past 6 months that I have been using ghci
and Haskell.
I wrote this function:
type Line = (Point,Point)
type Point = (Float,Float)
I found this blog post, which describes a way to protect against SQL
injection attacks using the type system, to be really enlightening.
http://blog.moertel.com/articles/2006/10/18/a-type-based-solution-to-the-strings-problem
Justin
___
Haskell-Cafe
On 16/04/07, Paul Wankadia [EMAIL PROTECTED] wrote:
Is it impossible for the compiler to infer the type from the methods called?
Your code:
main :: IO ()
main = do
x - new
From the use of 'new', the compiler can infer that the type of x is an
instance of MehBase, and...
Having just read Simon Marlow's paper on the Haskell Web Server, I
think it might be interesting to at least mention it, and how simple
it is, while still performing well.
Also, I second the comment several have made so far that talking
about concurrency is important. Haskell does it
What do you think of this plan? Are there features/bug-fixes that you really
want to see in 6.8?
I'm most anxious for parallel GC - do you think it will be another
release or two before this is a reality?
Thanks,
Chad
___
Haskell-Cafe mailing list
Mark T.B. Carroll wrote:
I'm afraid no
examples come easily to mind, though.
Here's a simple one: reading a flattened graph from disk. If your
flattened representation contains forward references, you have to fix
them up in a strict language. In a lazy language, you can refer to
elements
Bryan O'Sullivan [EMAIL PROTECTED] writes:
Mark T.B. Carroll wrote:
I'm afraid no
examples come easily to mind, though.
Here's a simple one: reading a flattened graph from disk. If your
flattened representation contains forward references, you have to fix
them up in a strict language.
Neil Bartlett wrote:
E.g. perhaps some kind of instant messaging server? Or Twitter except
scalable.
A twitter-alike will quite probably get people's attention. And of
course anything that breaks the it's good for compilers! stereotype is
to be commended :-)
Also on the subject of
Mark T.B. Carroll wrote:
Bryan O'Sullivan [EMAIL PROTECTED] writes:
Mark T.B. Carroll wrote:
I'm afraid no
examples come easily to mind, though.
Here's a simple one: reading a flattened graph from disk. If your
flattened representation contains forward references, you have to fix
them up
At Mon, 16 Apr 2007 13:44:13 +0100,
Neil Mitchell wrote:
Hi,
So my question is if this is safe? Will the compiler always pick the
right one? Is there a better way to do this?
I noticed that the results can be a bit suprising sometimes. See if
you can predict the answers to these (in ghci):
Jeremy Shaw wrote:
I noticed that the results can be a bit suprising sometimes. See if
you can predict the answers to these (in ghci):
Interesting examples. Here's another one that I would find problematic:
*SameType same Nothing (Just xyzzy)
False
*SameType same (Nothing ::
Hi Scott,
On Mon, Apr 09, 2007 at 10:03:55AM -0600, Scott Bell wrote:
Have you got a complete (but preferably small) program showing the
problem?
Great example, thanks!
Sorry for the delay in tracking it down.
main :: IO ()
main = do (_, h, _, p) - runInteractiveCommand telnet nyx.nyx.net
Neil Mitchell wrote:
Things
like laziness are cool, but are harder to convince a strict programmer
that they are useful.
Strict programmers like the yield command too. The same behaviour can
be obtained by laziness, with easier reasoning.
That said, strict programmers may or may not like
Simon Peyton-Jones [EMAIL PROTECTED] writes:
I'm quite excited about this: it is a great opportunity to expose Haskell to a
bunch of smart folk, many of whom won't know much about Haskell. My guess is
that they'll be Linux/Perl/Ruby types, and they'll be practitioners rather
than
Simon Peyton-Jones [EMAIL PROTECTED] writes:
My guess is that they'll be Linux/Perl/Ruby types, and they'll be
practitioners rather than pointy-headed academics.
Suggest concrete examples of programs that are
* small
* useful
*
pete-expires-20070615:
Simon Peyton-Jones [EMAIL PROTECTED] writes:
My guess is that they'll be Linux/Perl/Ruby types, and they'll be
practitioners rather than pointy-headed academics.
Suggest concrete examples of programs that are
* small
*
On Apr 16, 2007, at 9:29 PM, Donald Bruce Stewart wrote:
It's interesting to note that QuickCheck generalises unit testing:
zero-arity QC properties are exactly unit tests.
I don't think this works very well. I rely quite heavily on being
able to compare expected output with test results
joelr1:
On Apr 16, 2007, at 9:29 PM, Donald Bruce Stewart wrote:
It's interesting to note that QuickCheck generalises unit testing:
zero-arity QC properties are exactly unit tests.
I don't think this works very well. I rely quite heavily on being
able to compare expected output with
Are there any examples of such custom drivers?
On Apr 16, 2007, at 10:09 PM, Donald Bruce Stewart wrote:
That's just the default driver. Plenty of custom drivers exist which
compare the output. The QC driver is just a function you implement,
after all.
--
http://wagerlabs.com/
Why can't you just do 'f 1 2 3 == (4, 5, 6, 7)' to test f?
On Apr 16, 2007, at 22:08 , Joel Reymont wrote:
On Apr 16, 2007, at 9:29 PM, Donald Bruce Stewart wrote:
It's interesting to note that QuickCheck generalises unit testing:
zero-arity QC properties are exactly unit tests.
I don't
That's what HUnit does but it's enticing to be able to standardize on
QuickCheck for all of your testing.
On Apr 16, 2007, at 10:11 PM, Lennart Augustsson wrote:
Why can't you just do 'f 1 2 3 == (4, 5, 6, 7)' to test f?
--
http://wagerlabs.com/
I usually roll a new driver for each project, for example:
http://www.cse.unsw.edu.au/~dons/code/fps/tests/QuickCheckUtils.hs
and a smp parallel driver,
http://www.cse.unsw.edu.au/~dons/code/pqc/Test/QuickCheck/Parallel.hs
There's a few examples in Test.QuickCheck too.
joelr1:
Are
Jeremy Shaw wrote:
:
| However, I think this is buggy, because changes
| to 's' and 'w' will be lost if 'm' raises an
| exception.
:
That's determined by the way you stack your monad
transformers when declaring the type: adding error handling
to a writer monad, or adding writing to an error
DrIFT is a preproxessor so it makes the build process more complex. I'd like to
find a pure-haskell solution or a TH solution that doesn't require more build
complexity.
-Alex-
On Tue, 10 Apr 2007, Marc Weber wrote:
Right now, you can largely do the same thing, but you have to write the
On Mon, Apr 16, 2007 at 07:09:10PM -0400, S. Alexander Jacobson wrote:
On Tue, 10 Apr 2007, Marc Weber wrote:
Right now, you can largely do the same thing, but you have to write the
XML
representations of your data structures manually.
-Alex-
I'm not sure but doesn't use HAppS kind of
Blast.. i didn't hit reply all so here's a forward of my mail to the
group...
--ryan
-- Forwarded message --
From: Ryan Dickie [EMAIL PROTECTED]
Date: Apr 16, 2007 4:24 PM
Subject: Re: [Haskell-cafe] Tutorial on Haskell
To: Simon Peyton-Jones [EMAIL PROTECTED]
I can tell you
Hi
DrIFT is a preproxessor so it makes the build process more complex. I'd
like to find a pure-haskell solution or a TH solution that doesn't require
more build complexity.
You might want to look at the Data.Derive system. Basically it's a
giant library of helpers for writing TH-based
- Parsec is not that interesting for those coming from perl, ruby, or
python as they rely on regular expressions for everything and just
expect that they are part of the language. The thought of writing
one's own parser is not as cool as most Haskellers believe it is,
regardless of how
Evan Laforge [EMAIL PROTECTED] writes:
It illustrates a few nice things about haskell: laziness for the
recursive defs and easy backtracking, low syntax overhead and custom
operators for DSLs, composability, etc.
Although that is true, I somehow feel that showing a perl, ruby, or
python
Ah... so the secret is in the hidden variables. On some level I am
beginning to fear that Monads resurrect some of the scariest aspects of
method overriding from my OO programming days. Do you (all) ever find that
the ever changing nature of = makes code hard to read?
On 4/15/07, jeff p
david:
Ah... so the secret is in the hidden variables. On some
level I am beginning to fear that Monads resurrect some of
the scariest aspects of method overriding from my OO
programming days. Do you (all) ever find that the ever
changing nature of = makes code hard to
Donald Bruce Stewart wrote:
david:
Ah... so the secret is in the hidden variables. On some
level I am beginning to fear that Monads resurrect some of
the scariest aspects of method overriding from my OO
programming days. Do you (all) ever find that the ever
changing nature
clifford.beshers:
Donald Bruce Stewart wrote:
david:
Ah... so the secret is in the hidden variables. On some
level I am beginning to fear that Monads resurrect some of
the scariest aspects of method overriding from my OO
programming days. Do you (all) ever find
G'day all.
Quoting Neil Mitchell [EMAIL PROTECTED]:
I think its important to cover whats different about Haskell. Things
like laziness are cool, but are harder to convince a strict programmer
that they are useful.
I think you could. What you need to convince a strict programmer of is
that
The examples presented so far seem to show that the computation will
eventually run in the IO monad. One may wonder then why do we need
RWST transformer, given that the IO monad can implement both the state
and writer. At the very least me need the reader transformer, which is
the least demanding
On Apr 17, 2007, at 0:03 , [EMAIL PROTECTED] wrote:
eventually run in the IO monad. One may wonder then why do we need
RWST transformer, given that the IO monad can implement both the state
For what it's worth, I got the impression that RWST was an example of
a complex monad transformer ---
On Tuesday 17 April 2007 10:30, Pete Kazmier wrote:
From a
practical point of view, the tasks that I do frequently involve the
use of regexps (for better or worse).
Likewise. It's true that when regexps are readily available, everything can
look like a hammer; but sometimes a nail is just a
On Tuesday 17 April 2007 14:48, Alexis Hazell wrote:
Likewise. It's true that when regexps are readily available, everything can
look like a hammer; but sometimes a nail is just a nail. :-)
Er. i meant to say, when the regexp /hammer/ is readily available, everything
can look like a /nail/.
71 matches
Mail list logo