to generate infinite random
data-structures with it.
John Hughes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
From: Robert Dockins [EMAIL PROTECTED]
It seems to me that every possible use of a partial function has
some (possibly imagined) program invariant that prevents it from
failing. Otherwise it is downright wrong. 'head',
'fromJust' and friends don't do anything to put that invariant in
On 9/6/06, Tamas K Papp [EMAIL PROTECTED] wrote:
or does the compiler perform this optimization? More generally, if a
function is invoked with the same parameters again (and it doesn't
involve anything like monads), does does it makes sense
(performancewise) to store the result somewhere?
John Hughes wrote:
The trouble is that this isn't always an optimisation. Try these two
programs:
powerset [] = [[]]
powerset (x:xs) = powerset xs++map (x:) (powerset xs)
and
powerset [] = [[]]
powerset (x:xs) = pxs++map (x:) pxs
where pxs = powerset xs
Try computing length (powerset [1..n
From: Julien Oster [EMAIL PROTECTED]
Subject: [Haskell-cafe] Exercise in point free-style
I was just doing Exercise 7.1 of Hal Daumé's very good Yet Another
Haskell Tutorial. It consists of 5 short functions which are to be
converted into point-free style (if possible).
It's insightful and
Am Samstag, 4. März 2006 21:30 schrieb Neil Mitchell:
And a related question is: Which packages are searchable by Hoogle?
The best answer to that is some. I intentionally excluded OpenGL and
other graphics ones because they have a large interface and yet are
not used by most people
29% Parsec
19% wxHaskell
16% QuickCheck
16% haddock
12% Monadic Parser Combinators
11% Gtk2Hs
9% hs-plugins
8% HaXml
7% Data.*
7% Monad foundation classes
6% Arrows
6% HOpenGL
The list includes all libraries named by more than 5% of respondents.
Sure enough, wxHaskell and Gtk2Hs
Quoting Paul Hudak [EMAIL PROTECTED]:
Actually, one of the main reasons that we chose (:) is that that's what
Miranda used. So, at the time at least, it was not entirely clear what
the de facto universal inter-language standard was.
Phil Wadler argued for the ML convention at the time,
Lennart Augustsson wrote:
I now think :: for type signatures was a bad mistake.
I don't use lists very much. They are not the right data structure
for many things. So : is not as common as :: in my code.
I checked a small sample of code, about 2 lines of Haskell.
It has about 1000
Cale Gibbard wrote:
That said, I'd *really* like to see monad comprehensions come back,
since they align better with the view that monads are container types,
dual to the view that monads are computations, which is supported by
the do-syntax. This view is actually much easier to teach (in my
--
Message: 1
Date: Wed, 21 Dec 2005 10:48:08 +
From: Robin Green [EMAIL PROTECTED]
Subject: Re: [Haskell-cafe] Re: Tutorial uploaded
Beginners should start with non-monadic functions in order to later avoid
IO
a very one-sided view, ignoring the large effect that
ease of programming can have on the final system's performance.
John Hughes
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
in 1999. Here's the link:
http://www.cs.chalmers.se/~rjmh/Papers/restricted-datatypes.ps
Getting the right dictionaries to the right place involves adding a
concept of well-formed types, which perhaps is why it hasn't been taken
up by the Simons...
John Hughes
Message: 9
Date: Mon, 7 Feb 2005 10:31:30 -0500
From: Jacques Carette [EMAIL PROTECTED]
Subject: [Haskell-cafe] Top 20 ``things'' to know in Haskell
To: haskell-cafe@haskell.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii
The recent post of Graham Klyne (below)
I seriously considered switching frlom Hugs to GHC for my introductory
programming class this year, but in the end stayed with Hugs because of
a single feature.
I'm teaching beginning programmers, and for them at least, there is an
overwhelming volume of names to learn -- what's that function?
| Constraints on datatype declarations are a misfeature of Haskell, and
| have no useful effect.
|
| Is this the final conclusion?
Yes, it is, I believe. Constraints on data type declarations are a
mis-feature. I tried to get them removed, but there was some argument
that they could be made
, in the
hugs interpreter -- my tools only need to know how to work the hugs
interface. As the language evolves, I can keep up just by installing a
new version of hugs -- I have no parser and interpreter of my own to
maintain.
Easy and effective -- if a bit slow.
John Hughes
be deferred in
the way I describe.
If I remember rightly, OCaml allows type recursion of this sort, but
restricts it to object types precisely to avoid these problems.
John Hughes
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman
On Fri, 7 Jun 2002, Chris Moline wrote:
...
two. i have also read what the hell are monads and monads for the working
haskell programmer. i still do not get what i am doing wrong.
getDepends :: String - [String]
getDepends p = do
handle - openFile (portsDir ++ p ++ /+CONTENTS)
There's a combinator which Phil Wadler called guarantee which makes a
parser lazy -- guarantee p succeeds at once, with a result which will
be produced, when demanded, by p. Many parsing libraries include it under
one name or another...
John
___
?
^^
Probably in the same manner as with unsafePerformIO:
it can break referential transparency.
Indeed,
unsafePerformIO m = runST (unsafeIOToST m)
so they're just as unsafe as each other.
John Hughes
___
Haskell-Cafe mailing list
The easiest way to combine State and IO is using a monad transformer. There
are some lecture notes which you might find useful at
http://www.md.chalmers.se/~rjmh/Combinators/Monads/index.htm
which refer to a library module
Hi all, got some questions on recursive functions.
I got a simple recursive function (f3)
In *some* situations I'll want to know how many recursive calls did it make.
I came up with two simple implementations to do that (f1) and (f2)
f [] w = (w,0)
. Encapsulated stateful
operations like this fit very nicely with the functional style!
Take a look at State in Haskell, John Launchbury and Simon Peyton Jones,
http://www.cse.ogi.edu/~jl/Papers/stateThreads.ps
which explains all of this at length.
John Hughes
.
John Hughes
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
rror "I am the pope!"
but the seq form is nicer!
John Hughes
| -Original Message-
| From: Michael Marte [mailto:[EMAIL PROTECTED]]
|
|
|
| I am trying to process a huge bunch of large XML files in order
| to extract some dat
26 matches
Mail list logo