On Sun, Feb 18, 2007 at 06:15:25PM -0500, [EMAIL PROTECTED] wrote:
Now that's an industrial-strength Fibonacci. It's O(log n) not
including the cost of adding and multiplying large Integers, and
uses a bounded amount of memory between calls, making it suitable
for a library.
The slowest part
Am Donnerstag, 27. Januar 2005 06:08 schrieb William Lee Irwin III:
Inspired by a discussion on freenode #haskell, I tried to write the
fastest Fibonacci number function possible, i.e. given a natural
number input n to compute F_n.
For the moment, mlton-generated binaries crash computing fib
On Fri, Jan 28, 2005 at 08:16:59PM +0100, Henning Thielemann wrote:
But what do you mean with 1/O(n^2) ? O(f) is defined as the set of
functions bounded to the upper by f. So 1/O(f) has no meaning at the
first glance. I could interpret it as lifting (1/) to (\f x - 1 / f x)
(i.e. lifting from
On Fri, Jan 28, 2005 at 08:16:59PM +0100, Henning Thielemann wrote:
But what do you mean with 1/O(n^2) ? O(f) is defined as the set of
functions bounded to the upper by f. So 1/O(f) has no meaning at the
first glance. I could interpret it as lifting (1/) to (\f x - 1 / f x)
(i.e. lifting from
On Wed, Mar 09, 2005 at 12:42:09PM +0100, Henning Thielemann wrote:
I think it is a quite popular problem. I have a permutation and I want to
count how often a big number is left from a smaller one. More precisely
I'm interested in whether this number is even or odd. That's for instance
the
At 2001-01-18 15:57, William Lee Irwin III wrote:
class C a where
fun :: a - Integer
instance Integral a = C a where
fun = toInteger . succ
On Thu, Jan 18, 2001 at 04:04:01PM -0800, Ashley Yakeley wrote:
Gives "syntax error in instance head (constructor exp
On Thu, Feb 08, 2001 at 08:30:31PM +, Marcin 'Qrczak' Kowalczyk wrote:
Signum doesn't require Ord.
signum z = z / abs z
for complex numbers.
I'd be careful here.
\begin{code}
signum 0 = 0
signum z = z / abs z
\end{code}
This is, perhaps, neither precise nor general
Fri, 09 Feb 2001 10:52:39 +, Jerzy Karczmarczuk pisze:
Again, a violation of the orthogonality principle. Needing division
just to define signum. And of course a completely different approach
do define the signum of integers. Or of polynomials...
On Fri, Feb 09, 2001 at 07:19:21PM +,
On Sat, Feb 10, 2001 at 11:25:46AM -0500, Dylan Thurston wrote:
Can you elaborate? What do you mean by signum for functions? The
pointwise signum? Then abs would be the pointwise abs as well, right?
That might work, but I'm nervous because I don't know the semantics
for signum/abs in such
Sun, 11 Feb 2001 13:37:28 +1300, Brian Boutel [EMAIL PROTECTED] pisze:
Can you demonstrate a revised hierarchy without Eq? What would
happen to Ord and the numeric classes with default class method
definitions that use (==) either explicitly or in pattern matching
against numeric literals?
I
On 11-Feb-2001, Brian Boutel [EMAIL PROTECTED] wrote:
There may be some misunderstanding here. If you are talking about type
for which equality is always undefined, then I agree with you, but that
is not what I was talking about. I was thinking about types where
equality is defined for some
On Sun, Feb 11, 2001 at 05:42:15PM -0500, Dylan Thurston wrote:
I've started writing up a more concrete proposal for what I'd like the
Prelude to look like in terms of numeric classes. Please find it
attached below. It's still a draft and rather incomplete, but please
let me know any
At 2001-02-11 14:42, Dylan Thurston wrote:
I've started writing up a more concrete proposal for what I'd like the
Prelude to look like in terms of numeric classes. Please find it
attached below. It's still a draft and rather incomplete, but please
let me know any comments, questions, or
/(1-x), so x^(2n) - (-1)^n
and x^(2n+1) - (-1)^n x, but you end up with an infinite number of
(nonzero!) residues to add up and hence encounter the troubles with
processes not being finite that I mentioned.
On Sun, Feb 11, 2001 at 06:48:42PM -0800, William Lee Irwin III wrote:
(3) Under some
On Mon, Feb 12, 2001 at 05:24:37PM +1300, Brian Boutel wrote:
Including laws was discussed very early in the development of the
language, but was rejected. IIRC Miranda had them. The argument against
laws was that their presence might mislead users into the assumption
that they did hold, yet
At 2001-02-11 21:18, Tom Pledger wrote:
The main complication is that the type system needs to deal with
integer exponents of dimensions, if it's to do the job well.
On Sun, Feb 11, 2001 at 10:16:02PM -0800, Ashley Yakeley wrote:
Very occasionally non-integer or 'fractal' exponents of
In a later posting Marcin Kowalczyk says:
If (+) can be implicitly lifted to functions, then why not signum?
Note that I would lift neither signum nor (+). I don't feel the need.
...
On Mon, Feb 12, 2001 at 09:33:03AM +, Jerzy Karczmarczuk wrote:
I not only feel the need, but I feel
On Wed, Feb 14, 2001 at 02:19:39PM -0800, Simon Peyton-Jones wrote:
The most immediate and painful stumbling block in Haskell 98 is that
numeric literals, like 3, turn into (Prelude.fromInt 3), where
"Prelude.fromInt" really means "the fromInt from the standard Prelude"
regardless of whether
William Lee Irwin III [EMAIL PROTECTED] pisze:
literal "0" gets mapped to zero :: AdditiveMonoid t = t
literal "1" gets mapped to one :: MultiplicativeMonoid t = t
literal "5" gets mapped to (fromPositiveInteger 5)
literal "-9&quo
William Lee Irwin III [EMAIL PROTECTED] pisze:
literal "5" gets mapped to (fromPositiveInteger 5)
literal "-9" gets mapped to (fromNonZeroInteger -9)
On Fri, Feb 16, 2001 at 05:42:17PM +, Marcin 'Qrczak' Kowalczyk wrote:
Note that when a discussed generic
On Mon, Dec 10, 2001 at 12:58:33AM -0800, Simon Peyton-Jones wrote:
| Simon Peyton-Jones. The implementation of functional
| programming languages. Prentice-Hall, 1987
|
| is this book could be made available online ? cos on amazon
| it seems out of print.
I'm planning to scan
On Sun, Jan 13, 2002 at 01:43:32AM +, Liyang Hu wrote:
'fraid I've been too spoilt by Debian, haven't built anything from
source in ages ... I'll notify Hugs' package maintainer and see if I
can convince him/her to apply this ...
No trouble at all; I feel this should be the default as
On Wed, 31 Jul 2002, Andrew J Bromage wrote:
Perhaps the ICFP contests are actually fairer as benchmarks than as
competitions?
On Wed, Jul 31, 2002 at 09:59:31AM +0100, D. Tweed wrote:
Interesting thought, particularly if the judges announced changes to what
the problem to be solved was
module GT where
import Monad
import Monoid
import MonadState
import MonadWriter
import MonadRWS
-- Just a quick exercise in using monads.
-- Thought it'd be nice to share with the class.
data GOp
= PushVal Integer
| Push Integer
| Pop Integer
| Slide Integer
On Wed, 13 Nov 2002, William Lee Irwin III wrote:
main = mapM_ (\h - mapM_ putChar = hGetContents h) = mapM (flip openFile $
ReadMode) = getArgs
On Wed, Nov 13, 2002 at 07:46:41AM -0800, Hal Daume III wrote:
main = interact id
There is a semantic difference here, as the version I posted
On Mon, Dec 23, 2002 at 09:05:00AM +, Glynn Clements wrote:
The main problems with lazy I/O are the lack of control over ordering
(e.g. you can't delete the file until a stream has been closed, but
you may not be able to control how long the stream remains open), and
the inability to
On Mon, Oct 11, 2004 at 09:53:16PM -0400, Scott Turner wrote:
I tried using continued fractions in a spiffy lazy list implementation a
while ago. Never got them working as well as expected.
Evenutally I realized that calculating with lazy lists is not as
smooth as you might expect.
For
On Tue, Oct 12, 2004 at 08:48:27AM +0100, Simon Peyton-Jones wrote:
If you are interested in arbitrary precision arithmetic using continued
fractions, you may want to check out the work of David Lester. And
Peter Potts et al. Just type exact real arithmetic into Google.
That's where I got
On Wed, Oct 06, 2004 at 12:27:35PM +1000, Ben Lippmeier wrote:
Now imagine that state is some large structure. The [x] list is a couple
of hundred elements long, and you print out some - but not all - of
the [y] elements. While the [y] list remains live, a whole collection of
half
On Fri, Oct 08, 2004 at 08:35:40AM -0400, Robert Dockins wrote:
Actually, I've been wondering about this. If my understanding is
correct, Haskell lists are basicly singly-linked lists of cons cells (is
that correct?) A simple (I think) thing to do would be to make the
lists doubly-linked
At some point in the past, someone wrote:
Actually, I've been wondering about this. If my understanding is
correct, Haskell lists are basicly singly-linked lists of cons cells (is
that correct?) A simple (I think) thing to do would be to make the
lists doubly-linked and circular. That
William Lee Irwin III [EMAIL PROTECTED] writes:
Ugh, lousy cache properties... try rank-ordered B+ trees. There are
probably better choices than that even. It's probably best Simon point
us to references to what's actually useful here.
On Fri, Oct 08, 2004 at 03:55:05PM +0200, Ketil Malde
At some point in the past, someone's attribution was stripped from:
It can't be transparent. A different type for semi-packed strings,
On Fri, Oct 08, 2004 at 07:28:53PM +0100, MR K P SCHUPKE wrote:
Again I disagree... I dont see why you cannot change the implementation
of lists without
So, I discovered that simple continued fractions are supposed to be
spiffy lazy lists and thought I'd bang out some continued fraction code.
But then I discovered ContFrac.hs and couldn't really better it. Of
course, I went about trying to actually do things relying on their
laziness, and
On Sat, Oct 09, 2004 at 12:33:53PM -0700, William Lee Irwin III wrote:
So, I discovered that simple continued fractions are supposed to be
spiffy lazy lists and thought I'd bang out some continued fraction code.
But then I discovered ContFrac.hs and couldn't really better it. Of
course, I went
On Sat, Oct 09, 2004 at 12:33:53PM -0700, William Lee Irwin III wrote:
So, I discovered that simple continued fractions are supposed to be
spiffy lazy lists and thought I'd bang out some continued fraction code.
But then I discovered ContFrac.hs and couldn't really better it. Of
course, I went
Ben Rudiak-Gould [EMAIL PROTECTED] writes:
For this to really work properly the whole OS needs to be designed
around it. Such OSes exist -- they're called capability-based -- but
like so many other good ideas this one hasn't generated much interest
in industry. I think we're stuck with
Remi Turk [EMAIL PROTECTED] writes:
At least one. (Me) And, judging from the amount of references to
Python in these mailing-lists, I really doubt I'm the only one.
On Tue, Oct 26, 2004 at 09:21:10PM +0200, Shae Matijs Erisson wrote:
At least two. I also came to Haskell from Python.
I made a
On Tue, Oct 26, 2004 at 10:22:23PM +0200, Tomasz Zielonka wrote:
My road to Haskell went from C, C++ and Perl through Ocaml, Clean and
Erlang. I was mainly motivated by dissatisfaction with languages I used
at the moment. I am very happy with Haskell and I think I'll be using it
for some time.
On Tue, Nov 30, 2004 at 04:57:27PM +0100, Shae Matijs Erisson wrote:
The #haskell irc channel on irc.freenode.net is composed of many different
flavors of programmer, from self-educated 16 year olds on up to post doctoral
students studying functional programming.
I'm a self-educated,
On Wed, Dec 15, 2004 at 02:07:10AM -0800, William Lee Irwin III wrote:
This does not work as expected on Complex numbers due to some odd
typechecking hassles apparently associated with abs. How do I get this
to typecheck for both real (e.g. Double) and Complex arguments?
On Wed, Dec 15, 2004
This does not work as expected on Complex numbers due to some odd
typechecking hassles apparently associated with abs. How do I get this
to typecheck for both real (e.g. Double) and Complex arguments?
\begin{code}
module Jacobi (sn, cn, dn, sd, cd, nd, cs, ds, ns, sc, dc, nc) where
scd x k | abs
On 19 January 2005 09:45, Ben Rudiak-Gould wrote:
Okay, my ignorance of Posix is showing again. Is it currently the
case, then, that every GHC thread will stop running while a disk read
is in progress in any thread? Is this true on all platforms?
On Wed, Jan 19, 2005 at 01:39:05PM -, Simon
43 matches
Mail list logo