Hi Jeff,
I have a series of NxM numeric tables I'm doing a quick
mean/variance/t-test etcetera on. The cell t1 [i,j] corresponds exactly
to the cells t2..N [i,j], and so it's perfectly possible to read one
item at a time from each of the 100 files and compute the mean/variance
etcetera on all
On Tue, 2007-04-10 at 13:16 +1000, Duncan Coutts wrote:
Note, that like in your original we read each file twice, once for the
mean and once for the variance.
As an aside, you can calculate both mean and variance in one pass (and
constant space) by calculating the sum of elements 'x', the sum
HAVE_GETTIMEOFDAY is defined. I wrote a quick c program to check and I
can use gettimeofday fine. I can't work out why ghc can't find it. How
can I work out where ghc is searching to find it?
Chris.
On 3/30/07, Ian Lynagh [EMAIL PROTECTED] wrote:
On Fri, Mar 30, 2007 at 04:36:32PM +1000, Chris
On Apr 10, 2007, at 3:42 AM, Albert Y. C. Lai wrote:
Does option help? Like:
It did, together with a couple of 'try's.
Thanks, Joel
--
http://wagerlabs.com/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hi all,
I have to prettyprint infix expressions writing the least possible
parenthesis (taking in account precedence and associativity). A
simplified expression type could be:
data Expr = Val String |
-- Binary operators (using infix constructors)
Expr :+: Expr
Hi oleg,
On 4/9/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Alfonso Acosta wrote:
I have a type problem in my code which I dont know how to solve
data HDSignal a = HDSignal
class HDPrimType a where
class PortIndex a where
class SourcePort s where
-- Plug an external signal to the
Lennart Augustsson wrote:
It's not that hard to figure out an order to permute the arguments on
the stack before a tail call that minimizes that number of moves and
temporary locations. Lmlc did this 20 years ago. :)
Right, and that's what GHC does too, with a strongly-connected-component
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 stripped down HaXml ?
DrIft can derive HaXml instances automatically.
Where is the problem doing using DrIft?
Marc
Oren Ben-Kiki wrote:
The code is in http://hpaste.org/1314#a1 if anyone at all is willing
to take pity on me and explain what I'm doing wrong.
There is an important point to note about streaming, namely that it
conflicts with knowing whether the input is syntactically correct or
not. In other
Hi All,Inspired by Oleg's Eliminating Array Bound Checking through
Non-dependent types http://okmij.org/ftp/Haskell/types.html#branding,I am
attempting to write code that will receive an array from C land and convert
it to a type safe representation. The array could have n dimensions where n
Folks,
Imagine a language where Num + Num yields a Num and Str + Num yields
a Str but Num + Str should not be allowed.
I implemented parsing for such a language in OCaml with a yacc-based
parser without an additional type-checking pass, entirely within the
yacc grammar. I tried to take
Hello all,
I have found myself writing instances of Show for some types of
mine, and I did so by defining the showsPrec function, for performance
reasons. I ended up with code that I find quite inelegant. Here's
an example:
data Move = Move {
movePiece ::
Maxime Henrion wrote:
Hello all,
I have found myself writing instances of Show for some types of
mine, and I did so by defining the showsPrec function, for performance
reasons. I ended up with code that I find quite inelegant. Here's
an example:
data Move = Move {
On Tue, Apr 10, 2007 at 02:33:41PM +0100, Chris Kuklewicz wrote:
Well, since ((.) :: ShowS - ShowS - ShowS) is a Monoid, you can use Writer
to
create the result:
Not portably.
[EMAIL PROTECTED]:~$ ghc-6.4.2 -e '( (foo++) `Data.Monoid.mappend` (bar++)
) END'
foobarEND
[EMAIL PROTECTED]:~$
New wiki page: Checking for correct invocation of a command line haskell program
at
http://haskell.org/haskellwiki/Checking_for_correct_invocation_of_a_command_line_haskell_program
This is a simple cookbook / boilerplate example I thought should go in
a haskell wiki somewhere.
I linked it
there was a minor mistake in the above, fixed on the wiki page.
2007/4/10, Thomas Hartman [EMAIL PROTECTED]:
New wiki page: Checking for correct invocation of a command line haskell program
at
http://haskell.org/haskellwiki/Checking_for_correct_invocation_of_a_command_line_haskell_program
Thanks, Ketil. I knew I could calcuate the mean in constant space, but
I didn't think about the variance. Much appreciated.
On Tue, 2007-04-10 at 08:30 +0200, Ketil Malde wrote:
On Tue, 2007-04-10 at 13:16 +1000, Duncan Coutts wrote:
Note, that like in your original we read each file
Using the Endo newtype can avoid such ambiguities:
http://darcs.haskell.org/packages/base/Data/Monoid.hs
newtype Endo a = Endo { appEndo :: a - a }
instance Monoid (Endo a) where
mempty = Endo id
Endo f `mappend` Endo g = Endo (f . g)
Endo allows you to explicitly select the
Nicolas Frisby wrote:
Not portably.
[EMAIL PROTECTED]:~$ ghc-6.4.2 -e '( (foo++) `Data.Monoid.mappend`
(bar++) ) END'
foobarEND
[EMAIL PROTECTED]:~$ ghc-6.6 -e '( (foo++) `Data.Monoid.mappend`
(bar++) ) END'
fooENDbarEND
-- 6.6 sources
instance Monoid b = Monoid (a - b) where
Hi,
I'd like to set up a Trac for Haddock on hackage.haskell.org. Who should I
contact?
/David
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi
I'd like to set up a Trac for Haddock on hackage.haskell.org. Who should I
contact?
Couldn't we use the bug tracker in Google Code? Its much better than
the Trac one, much more useable, and they host it for us even. Think
of it as Google giving us the gift of a perfectly formed bug tracker
On Tue, 2007-04-10 at 12:14 +0200, apfelmus wrote:
Oren Ben-Kiki wrote:
The code is in http://hpaste.org/1314#a1 if anyone at all is willing
to take pity on me and explain what I'm doing wrong.
There is an important point to note about streaming, namely that it
conflicts with knowing whether
So then tail calls should be very cheap when most of the arguments
don't change.
On Apr 10, 2007, at 10:17 , Simon Marlow wrote:
Lennart Augustsson wrote:
It's not that hard to figure out an order to permute the arguments
on the stack before a tail call that minimizes that number of
reply = parse ... -- Lazily evaluated
tokens = rTokens reply -- Has some values immediately
list = D.toList tokens -- Has some values immediately
mapM_ list print -- Start printing immediately!
..
reply = parse ... -- Lazily evaluated
result = rResult reply -- Lazy; has value when parsing is
Hello,
For my own exercise I'm writing a function 'weave' that weaves a
list of lists together. For example:
weave [[1,1,1], [2,2,2], [3,3]] == [1,2,3,1,2,3,1,2]
weave [[1,1,1], [2,2], [3,3,3]] == [1,2,3,1,2,3,1]
Note that 'weave' stops when a list is empty. Right now I have:
weave ::
On Tue, Apr 10, 2007 at 07:59:04PM +0100, Lennart Augustsson wrote:
So then tail calls should be very cheap when most of the arguments
don't change.
On Apr 10, 2007, at 10:17 , Simon Marlow wrote:
Lennart Augustsson wrote:
It's not that hard to figure out an order to permute the
On Tue, Apr 10, 2007 at 11:03:32AM -0700, Oren Ben-Kiki wrote:
On Tue, 2007-04-10 at 12:14 +0200, apfelmus wrote:
Oren Ben-Kiki wrote:
The code is in http://hpaste.org/1314#a1 if anyone at all is willing
to take pity on me and explain what I'm doing wrong.
There is an important point to
On Wed, Apr 11, 2007 at 12:13:10AM +0200, Bas van Dijk wrote:
Hello,
For my own exercise I'm writing a function 'weave' that weaves a
list of lists together. For example:
weave [[1,1,1], [2,2,2], [3,3]] == [1,2,3,1,2,3,1,2]
weave [[1,1,1], [2,2], [3,3,3]] == [1,2,3,1,2,3,1]
Note that
On Tue, Apr 10, 2007 at 09:20:52AM +0200, Alfonso Acosta wrote:
I have to prettyprint infix expressions writing the least possible
parenthesis (taking in account precedence and associativity). A
simplified expression type could be:
Your use of 'have' is slightly suspicious here. That said,
Bas van Dijk:
For my own exercise I'm writing a function 'weave' that weaves a
list of lists together. For example:
weave [[1,1,1], [2,2,2], [3,3]] == [1,2,3,1,2,3,1,2]
weave [[1,1,1], [2,2], [3,3,3]] == [1,2,3,1,2,3,1]
Note that 'weave' stops when a list is empty.
This *almost* does
Here's a very different approach. I make no claim to increased
elegance or efficiency, though I find it fairly readable and its made
of reusable parts. (Of course that's how you always finds your own
code!)
import Prelude hiding (head,tail)
-- Some would say this is how head and tail should
Talk about synchronicity! I was just wondering whether 'weaving' of
infinite lists is possible.
eg weave the infinite lists [2,4..], [3,6..], [5,10..]
to get [2,3,4,5,6,8,9,10,..]
Is this kind of lazy evaluation possible?
Thanks,
Dave Feustel
-Original Message-
From: Bas van Dijk
This reminded me of interleaving as in:
Backtracking, Interleaving, and Terminating Monad Transformers
http://www.cs.rutgers.edu/~ccshan/logicprog/LogicT-icfp2005.pdf
On 4/10/07, Dave Feustel [EMAIL PROTECTED] wrote:
Talk about synchronicity! I was just wondering whether 'weaving' of
infinite
Bas van Dijk [EMAIL PROTECTED] writes:
Hello,
For my own exercise I'm writing a function 'weave' that weaves a
list of lists together. For example:
weave [[1,1,1], [2,2,2], [3,3]] == [1,2,3,1,2,3,1,2]
weave [[1,1,1], [2,2], [3,3,3]] == [1,2,3,1,2,3,1]
[...]
So I'm wondering if 'weave'
I ask this question because I want to program a recently published
algorithm for directly enumerating all prime numbers. The algorithm
description uses infinite sets. The algorithm could possibly be
programmed using lazy evaluation.
-Original Message-
From: Ricardo Herrmann [EMAIL
On Tue, Apr 10, 2007 at 02:09:03PM +0100, Joel Reymont wrote:
Folks,
Imagine a language where Num + Num yields a Num and Str + Num yields
a Str but Num + Str should not be allowed.
I implemented parsing for such a language in OCaml with a yacc-based
parser without an additional
On 4/11/07, Stefan O'Rear [EMAIL PROTECTED] wrote:
Your use of 'have' is slightly suspicious here. That said, the rest
of your problem looks very un-homework-y, so I'll look at it.
It's for my masters thesis (big piece of badly-specified homework if
you want to think about it like that :)).
On Wed, Apr 11, 2007 at 01:53:49AM +0200, Alfonso Acosta wrote:
On 4/11/07, Stefan O'Rear [EMAIL PROTECTED] wrote:
Your use of 'have' is slightly suspicious here. That said, the rest
of your problem looks very un-homework-y, so I'll look at it.
It's for my masters thesis (big piece of
Dave Feustel:
Talk about synchronicity! I was just wondering whether 'weaving' of
infinite lists is possible.
eg weave the infinite lists [2,4..], [3,6..], [5,10..]
to get [2,3,4,5,6,8,9,10,..]
Is this kind of lazy evaluation possible?
The base library version of (concat . transpose)
Alfonso Acosta wrote:
I tried the existential approach when it was previously suggested by
Chris, but the problem is that, for some Source instances calling
methods from HDPrimType within supplySig is not enough. Thus, it
doesn't work with existentials due to their limitations.
I see. The
40 matches
Mail list logo