Write a function with three parameters, two atoms and a list, (say p1, p2
and L) that returns the list, L, with all occurrences of the first given atom,
p1, replaced by the second one, p2. If P2 be nil, the given atom should be
deleted and the returned list cannot contain anything in place
On Thu, 2007-04-12 at 23:38 -0700, SevenThunders wrote:
I saw a lot of options for places to put sources and targets, but I couldn't
quite figure out how to configure it to place the object file output. No
doubt
it's there, I just couldn't find it in the 45 min.s or so that I looked for
[EMAIL PROTECTED] wrote:
You have n elements, and you need to locate a specific k-element
permutation. There are n! / (n-k)! such permutations. You therefore
need log(n! / (n-k)!) bits of information.
A binary comparison provides one bit of information. So the number of
comparisons that
On 4/14/07, Steffen Mazanek [EMAIL PROTECTED] wrote:
Brian, but don't you think that you have to write a lot
of boilerplate code in Haskell?
I have never felt I was writing a lot of boilerplate. There are a lot of
abstraction mechanisms in Haskell to avoid boilerplate.
Second, if Haskell
Thanks again to the answers Stefan,
Il giorno Apr 14, 2007, alle ore 1:41 AM, Stefan O'Rear ha scritto:
On Sat, Apr 14, 2007 at 01:31:58AM +0200, Fawzi Mohamed wrote:
Il giorno Apr 14, 2007, alle ore 12:33 AM, Stefan O'Rear ha scritto:
On Sat, Apr 14, 2007 at 12:27:10AM +0200, Fawzi
Hi
Write a function with three parameters, two atoms and a list, (say p1, p2
and L) that returns the list, L, with all occurrences of the first given
atom, p1, replaced by the second one, p2. If P2 be nil, the given atom
should be deleted and the returned list cannot contain anything in place
by utilizing Text.Printf.printf, extracting some more common functionality for the lookups,
and changing the error handling (check for errors before giving results, but use throwError
instead of error, letting the caller decide whether errors are fatal or not), we arrive at
something like:
On 4/14/07, Fawzi Mohamed [EMAIL PROTECTED] wrote:
but making my worker threads if I know the number of worker will be
more efficient, my program is extremely parallel, but putting a par
everywhere would be very memory costly and would probably break the
program in the wrong places, I know
x = x a + b
Now use high school algebra
x = x*a + b
x - x*a = b
x*(1-a) = b
x = b / (1-a)
x = b * 1/(1-a)
Now you have to remember that the Taylor series expansion of 1/(1-a) is
1/(1-a) = 1 + a + a^2 + a^3 + a^4 + ...
OK, now put your grammar hat back on. What's
1 | a | aa | aaa
Il giorno Apr 14, 2007, alle ore 2:45 PM, Sebastian Sylvan ha scritto:
I think you should probably consider the extremely lightweight
forkIO threads as your work items and the GHC runtime as your
thread pool system (it will find out how many threads you want
using the RTS options and
This is probably an off-topic question, but I can't think of a better
forum to ask it: does the existance of monads imply laziness in a
language, at least at the monadic level?
Consider the following: a purely functional, eagerly evaluated programming
language, that uses monads to
On Sat, Apr 14, 2007 at 10:56:44AM -0400, Brian Hurt wrote:
This is probably an off-topic question, but I can't think of a better
forum to ask it: does the existance of monads imply laziness in a
language, at least at the monadic level?
Consider the following: a purely functional,
Hi Haskell Café!
I'm writing a perl/python like string templating system which I plan
to release soon:
darcs get http://darcs.johantibell.com/template
The goal is to provide simple string templating; no inline code, etc..
An alternative to printf and ++.
Example usage:
import qualified
I wish to optimize Haskell code using ByteString, direct reading
Doubles form it, direct writing Doubles to it.
I've tried Don Stewart's code http://hpaste.org/26
that uses calling to C functions to implement necessary readDouble showDouble.
readDouble works ok.
showDouble always return nan in
On Sat, Apr 14, 2007 at 07:58:25PM +0400, Sergey Perminov wrote:
I wish to optimize Haskell code using ByteString, direct reading
Doubles form it, direct writing Doubles to it.
I've tried Don Stewart's code http://hpaste.org/26
that uses calling to C functions to implement necessary
Brian Hurt wrote:
This is probably an off-topic question, but I can't think of a better
forum to ask it: does the existance of monads imply laziness in a
language, at least at the monadic level?
Consider the following: a purely functional, eagerly evaluated
programming language, that uses
I'm writing a code generator for C, and I'm trying to parse a C-like
input language using LL(1) (parsec specifically). The syntax of
declarators is giving me trouble: (simplified)
declaration = qualifiers (declarator `sepBy1` char ',')
qualifiers = many1 name
declarator = name
now if we have
G'day all.
I wrote:
O(log(n! / (n-k)!))
= O(n log n - (n-k) log (n-k))
= O(n log (n/(n-k)) + k log (n-k))
That looks right to me. If k n, then this simplifies to
O(n + k log n), and if k is close to n, it simplifies to
O(n log n + k).
Quoting Ian Lynagh [EMAIL PROTECTED]:
18 matches
Mail list logo