I have not been following the details, but yes, the strictness analyser
only runs when you say -O, and without strictness analysis you can get
different space behaviour. Sometimes more, sometimes less. In this
case, strictness analysis helps.
Simon
| -Original Message-
| From: [EMAIL
Tomasz Zielonka [EMAIL PROTECTED] writes:
Record field labels can be also used in pattern matching and in
record update. Especially the latter is very useful.
But not quite as elegant -- while record query lets you modify the
underlying structure and replace the old record queries with
Hi everyone,
I had the idea that, instead of using 'seq', one might check for parity:
countLines2 aux (_:l)
| even aux = ...
| odd aux = ...
that prevents stack overflow, but is much slower than
countLines1 aux (_:l)
| aux `seq` False = ...
| otherwise = ...
I
On Mon, 2004-12-13 at 14:56 -0500, S. Alexander Jacobson wrote:
Hmm cool. Binary does not appear in the GHC
docs... Is it new?
Ah, it's not a user library distributed with GHC, it's a library used
internally in the implementation of GHC. If you want to use it you have
to rip it out of the ghc
What is a function of the followning type called:
f :: (Monad m) = (a - m b)
Is there a special term describing such a function (a function into a monad)?
For f in
a = f
is en example.
Need it for an article/report.
Regards/Henning
___
Haskell-Cafe
What is a function of the followning type called:
f :: (Monad m) = (a - m b)
Is there a special term describing such a function (a function into a monad)?
It is often called a procedure or an effectful function (I assume that
`a' and `b' are not meant to be universally quantified). I
Hi,
I often have a situation where I'm designing specialized components to
do a more general task. Examples could include mail folder code (maildir,
mbox, etc), configuration file parsing, protocol handlers for URL
accesses, logging backends, etc.
For some of these, I've used a data object
Major apologies for this repeated plug for HList.
Anyway, HLists [1] are *exactly* designed for this sort of problem.
Well, one can also use existential quantification + bounded polymorphism;
with the shapes benchmark providing a good example [2]. The trade-offs are
explored a little bit on the
On Tue, Dec 14, 2004 at 11:23:24AM +0100, Henning Thielemann wrote:
On Tue, 14 Dec 2004, Andrew Pimlott wrote:
(Of course, it's still useful, by itself or in a slice, as a higher-order
operator.)
You can also use 'id' in this cases, right?
I'm thinking of things like
zipWith ($)
On the other hand, it's difficult or impossible to make a list of a
bunch of different types of things that have nothing in common save
being members of the class.
I've recently been playing with making, for each class C, a
interface datatype IC (appropriately universally and existentially
On Mon, Dec 13, 2004 at 11:29:56AM +0100, Ketil Malde wrote:
Tomasz Zielonka [EMAIL PROTECTED] writes:
Record field labels can be also used in pattern matching and in
record update. Especially the latter is very useful.
But not quite as elegant -- while record query lets you modify the
Will,
countLines [] = 0
countLines (_:ls) = 1 + countLines ls
I would have thought that this was tail recursive and would be
flattened into iteration by the compiler. Can anyone explain why? Is
it because the call is embedded in an expression?
This is the tail-recursive version:
\begin{code}
On Mon, Dec 13, 2004 at 11:56:45AM +0100, Daniel Fischer wrote:
I had the idea that, instead of using 'seq', one might check for parity:
countLines2 aux (_:l)
| even aux = ...
| odd aux = ...
that prevents stack overflow, but is much slower than
countLines1 aux (_:l)
The operator ($) is often considered an application operator of a
lower precedence. Modulo precedence, there seem to be no difference
between ($) and `the white space', and so one can quickly get used to
treat these operators as being semantically the same. However, they
are not the same in all
On Mon, Dec 13, 2004 at 07:49:00PM -0800, [EMAIL PROTECTED] wrote:
The operator ($) is often considered an application operator of a
lower precedence. Modulo precedence, there seem to be no difference
between ($) and `the white space', and so one can quickly get used to
treat these operators
15 matches
Mail list logo