Achim Schneider wrote:
whereas lim( 0 ) * lim( inf ) is anything you want
Indeed I suppose that »lim inf«, which is a notation I'm not familiar
with, is not actually defined to mean anything?
Kalman
--
Find out how you can get
Kalman Noel [EMAIL PROTECTED] wrote:
Achim Schneider wrote:
whereas lim( 0 ) * lim( inf ) is anything you want
Indeed I suppose that »lim inf«, which is a notation I'm not familiar
with, is not actually defined to mean anything?
It's an ad-hoc expression of as the slices approach zero
On Sat, 12 Jan 2008, Achim Schneider wrote:
Kalman Noel [EMAIL PROTECTED] wrote:
Achim Schneider wrote:
whereas lim( 0 ) * lim( inf ) is anything you want
Indeed I suppose that »lim inf«, which is a notation I'm not familiar
with, is not actually defined to mean anything?
It's an
Achim Schneider [EMAIL PROTECTED] wrote:
Kalman Noel [EMAIL PROTECTED] wrote:
Achim Schneider wrote:
whereas lim( 0 ) * lim( inf ) is anything you want
Indeed I suppose that »lim inf«, which is a notation I'm not
familiar with, is not actually defined to mean anything?
It's an
Achim Schneider wrote:
Actually, lim( 0 ) * lim( inf ) isn't anything but equals one, and
the anything is defined to one (or, rather, is _one_ anything) to be
able to use the abstraction. It's a bit like the difference between
eight pens and a box of pens. If someone knows how to properly
Is my problem here, simply that the forall extension in GHC is
misleading.that the forall in
MkSwizzle :: (forall a. Ord a = [a] - [a]) - Swizzle
is not the same beast as the forall in..
data Accum a = forall s. MkAccum s (a - s - s) (s - a)
really
data Accum a = exists s. MkAccum s
On Sat, 12 Jan 2008 13:23:41 +0200, Kalman Noel
[EMAIL PROTECTED] wrote:
Achim Schneider wrote:
Actually, lim( 0 ) * lim( inf ) isn't anything but equals one, and
the anything is defined to one (or, rather, is _one_ anything) to be
able to use the abstraction. It's a bit like the difference
In Data.ByteString.Unsafe in the documentation of unsafePackAddress
the documentation reads:
Use unsafePackAddress if you know the length of the string statically.
I assume that unsafePackAddressLen is the being function referred to
here. If I was sitting in front of my laptop I would send you
Kalman Noel [EMAIL PROTECTED] wrote:
Achim Schneider wrote:
Actually, lim( 0 ) * lim( inf ) isn't anything but equals one, and
the anything is defined to one (or, rather, is _one_ anything) to be
able to use the abstraction. It's a bit like the difference between
eight pens and a box of
On Jan 9, 2008 5:43 PM, Derek Elkins [EMAIL PROTECTED] wrote:
A shorter and lighter and and also interesting and entertaining read is:
http://research.microsoft.com/~simonpj/Papers/haskell-retrospective/index.htm
While the reason Haskell was pure was to support laziness, at this point
though
Linq went live in C# in November, as part of .Net 3.5.
It adds lots of FP-things to C#.
It's really fun to be able to use Haskell-ish things in C#.
Manipulating lists and collections just got *much* easier.
Things it does:
- map, fold, filter are all there (they're called select, agregate,
Yes indeed. And you forget expression trees: code gets translated into
an AST like tree, and then you can use that tree for anything you want
(like compiling different other code, or code for another platform)
Hugh Perkins wrote:
Linq went live in C# in November, as part of .Net 3.5.
It adds
On Fri, Jan 11, 2008 at 06:50:02PM +0100, Peter Verswyvelen wrote:
It seems GHC 6.8.2 fixes a couple of bugs in GHC 6.8.1, so I'm using
that one.
Gtk2HS does not yet detect my GHC 6.8.2 installation, but I guess it is
100% compatible.
No, it's not binary-compatible. You'll need a Gtk2HS
2008/1/12, Cristian Baboi [EMAIL PROTECTED]:
Suppose lim a_n = a , lim b_n = b, c_2n = a_n, c_2n+1 = b_n.
What is lim c_n ?
This reminds me of these good old days in Classe prépa (something
typically french) doing these silly things with sequences and
Epsilons...
So let's try to do it :
On Fri, 2008-01-11 at 19:14 -0800, Jonathan Cast wrote:
These are all known and expected. As I said, you can expect lazy
versions to normally be slower than explicit loops. The question is
whether 50% more time and 300% more memory has a higher cost in your
case than the extra
I'd like to announce the release of a new version of the library
following various contributions (contributors are bcc'd).
Additions include: BubbleBabble, TEA, HMAC and more large word support.
It no longer includes Base64. This is provided by
On 12 Jan 2008, at 1:45 AM, Achim Schneider wrote:
Kalman Noel [EMAIL PROTECTED] wrote:
Achim Schneider wrote:
whereas lim( 0 ) * lim( inf ) is anything you want
Indeed I suppose that »lim inf«, which is a notation I'm not familiar
with, is not actually defined to mean anything?
It's an
On Sat, 2008-01-12 at 10:11 -0800, Jonathan Cast wrote:
A nit: the list is almost certainly getting created lazily, or you'd
get more than 300% more memory usage. But you still get the list's
cons cells as your bookkeeping baggage, and they take up space in
exchange for greater
On Sat, 12 Jan 2008 13:55:19 +0200, Kalman Noel
[EMAIL PROTECTED] wrote:
Cristian Baboi:
Suppose lim a_n = a , lim b_n = b, c_2n = a_n, c_2n+1 = b_n.
What is lim c_n ?
If my intuition was of any importance here, it would claim that c_n
diverges, because if I roughly approximate c_n by the
Hello,
I have been browsing through the problems at projecteuler.net and I
found one that seemed interesting. It's the problem 176, I'll state it
here:
The four rectangular triangles with sides (9,12,15), (12,16,20),
(5,12,13) and (12,35,37) all have one of the shorter sides
On Jan 12, 2008 10:19 PM, Rafael Almeida [EMAIL PROTECTED] wrote:
After some profiling I found out that about 94% of the execution time is
spent in the ``isPerfectSquare'' function.
I guess that Haskell's referential transparence means the answers to
the isPerfectSquare will be cached, ie
On Jan 12, 2008 9:19 PM, Rafael Almeida [EMAIL PROTECTED] wrote:
After some profiling I found out that about 94% of the execution time is
spent in the ``isPerfectSquare'' function.
That function is quite inefficient for large numbers. You might try
something like this:
isPerfectSquare n =
You can do better than this, too, actually. It looks like you're
using isPerfectSquare inside a filter, which is given a monotone
sequence. That means we can do:
-- finds the intersection of two monotone sequences
intersectMonotone :: (Ord a) = [a] - [a] - [a]
intersectMonotone (x:xs)
Rafael Almeida [EMAIL PROTECTED] wrote:
perfectSquares :: [Integer]
perfectSquares = zipWith (*) [1..] [1..]
isPerfectSquare :: Integer - Bool
isPerfectSquare x = (head $ dropWhile (x) perfectSquares) == x
what about
module Main where
isPerfectSquare :: Integer - Bool
isPerfectSquare n =
Achim Schneider [EMAIL PROTECTED] wrote:
Rafael Almeida [EMAIL PROTECTED] wrote:
perfectSquares :: [Integer]
perfectSquares = zipWith (*) [1..] [1..]
isPerfectSquare :: Integer - Bool
isPerfectSquare x = (head $ dropWhile (x) perfectSquares) == x
what about
module Main where
On Jan 12, 2008 7:12 PM, Achim Schneider [EMAIL PROTECTED] wrote:
what about
module Main where
isPerfectSquare :: Integer - Bool
isPerfectSquare n = sqrrt == fromIntegral (truncate sqrrt)
where sqrrt = sqrt $ fromIntegral n
? It's a hell alot faster, but I have no idea if some
Am Samstag, 12. Januar 2008 22:48 schrieb Luke Palmer:
On Jan 12, 2008 9:19 PM, Rafael Almeida [EMAIL PROTECTED] wrote:
After some profiling I found out that about 94% of the execution time is
spent in the ``isPerfectSquare'' function.
That function is quite inefficient for large numbers.
Cristian Baboi wrote:
Cristian Baboi:
Suppose lim a_n = a , lim b_n = b, c_2n = a_n, c_2n+1 = b_n.
What is lim c_n ?
If my intuition was of any importance here, it would claim that c_n
diverges, because if I roughly approximate c_n by the sequence c' =
⟨a,b,a,b,...⟩, then I note that c'
On Sat, 12 Jan 2008, Hugh Perkins wrote:
On Jan 12, 2008 10:19 PM, Rafael Almeida [EMAIL PROTECTED] wrote:
After some profiling I found out that about 94% of the execution time is
spent in the ``isPerfectSquare'' function.
I guess that Haskell's referential transparence means the answers
Achim Schneider [EMAIL PROTECTED] wrote:
Achim Schneider [EMAIL PROTECTED] wrote:
Rafael Almeida [EMAIL PROTECTED] wrote:
perfectSquares :: [Integer]
perfectSquares = zipWith (*) [1..] [1..]
isPerfectSquare :: Integer - Bool
isPerfectSquare x = (head $ dropWhile (x)
On 12 Jan 2008, at 10:26 AM, Andre Nathan wrote:
On Sat, 2008-01-12 at 10:11 -0800, Jonathan Cast wrote:
A nit: the list is almost certainly getting created lazily, or you'd
get more than 300% more memory usage. But you still get the list's
cons cells as your bookkeeping baggage, and they
On 12 Jan 2008, at 23:16, Hugh Perkins wrote:
On Jan 12, 2008 10:54 PM, Henning Thielemann
[EMAIL PROTECTED] wrote:
On Sat, 12 Jan 2008, Hugh Perkins wrote:
I guess that Haskell's referential transparence means the answers to
the isPerfectSquare will be cached, ie automatically memoized?
(While writing this message GMail told me I was too late to answer the
question. Oh well, as I already typed it, let's send =)
On Jan 12, 2008 9:16 PM, Hugh Perkins [EMAIL PROTECTED] wrote:
Interesting... but I dont understand... I thought that referential
transparence meant that once the
On Sun, 13 Jan 2008, Hugh Perkins wrote:
On Jan 12, 2008 10:54 PM, Henning Thielemann
[EMAIL PROTECTED] wrote:
On Sat, 12 Jan 2008, Hugh Perkins wrote:
I guess that Haskell's referential transparence means the answers to
the isPerfectSquare will be cached, ie automatically
On Jan 12, 2008, at 18:16 , Hugh Perkins wrote:
On Jan 12, 2008 10:54 PM, Henning Thielemann
[EMAIL PROTECTED] wrote:
On Sat, 12 Jan 2008, Hugh Perkins wrote:
I guess that Haskell's referential transparence means the answers to
the isPerfectSquare will be cached, ie automatically memoized?
On Jan 12, 2008 10:54 PM, Henning Thielemann
[EMAIL PROTECTED] wrote:
On Sat, 12 Jan 2008, Hugh Perkins wrote:
I guess that Haskell's referential transparence means the answers to
the isPerfectSquare will be cached, ie automatically memoized? (not
sure if is correct term?)
On 1/12/08, Henning Thielemann [EMAIL PROTECTED] wrote:
Caching is not the default, but you can easily code this by yourself:
Define an array and initialize it with all function values. Because of
lazy evaluation the function values are computed only when they are
requested and then they
On 12 Jan 2008, at 3:30 PM, David Benbennick wrote:
On 1/12/08, Henning Thielemann [EMAIL PROTECTED] wrote:
Caching is not the default, but you can easily code this by
yourself:
Define an array and initialize it with all function values.
Because of
lazy evaluation the function values are
Rafael Almeida [EMAIL PROTECTED] wrote:
[perfect square problem]
most of this is shamelessly stolen from
http://www.haskell.org/haskellwiki/Generic_number_type#squareRoot
(^!) :: Num a = a - Int - a
(^!) x n = x^n
isSquare :: Integer - Bool
isSquare n =
let newtonStep x = div (x + div n
On Sat, 12 Jan 2008, David Benbennick wrote:
On 1/12/08, Henning Thielemann [EMAIL PROTECTED] wrote:
Caching is not the default, but you can easily code this by yourself:
Define an array and initialize it with all function values. Because of
lazy evaluation the function values are
Achim Schneider [EMAIL PROTECTED] wrote:
the last one take a bit less than 20 secs on my pc. And 2^2^16 is a
number that takes at least an hour to pronounce.
Which means that I'm an absolute genius when it comes to fucking up
perfectly good algorithms.
--
(c) this sig last receiving data
On Jan 12, 2008 11:30 PM, David Benbennick [EMAIL PROTECTED] wrote:
On 1/12/08, Henning Thielemann [EMAIL PROTECTED] wrote:
Caching is not the default, but you can easily code this by yourself:
Define an array and initialize it with all function values. Because of
lazy evaluation the
Is there a fast and reliable way to compute the fraction of a floating
point number?
I can implement
fraction x = snd (properFraction x :: (Int, Double))
or
fraction x = x - fromIntegral (truncate x :: Int)
(actually I need 'floor' not 'truncate' but this is another issue)
but these
G'day all.
Quoting Henning Thielemann [EMAIL PROTECTED]:
The rare cases occur for big numbers.
http://www.haskell.org/haskellwiki/Generic_number_type#isSquare
How big, you might ask?
Prelude let dd = undefined :: Double in floatRadix dd ^ floatDigits dd
9007199254740992
Pretty big, and
So, I've been playing around with what I call the trivial monad:
module TrivialMonad where
data TrivialMonad a = M a
recover :: TrivialMonad a - a
recover (M x) = x
instance Monad TrivialMonad where
(M x) = f = f x
(M x) f = f
return x = M x
fail s =
Brian Hurt wrote:
The second question I have is: is there any hope of getting something
like this into the standard library?
the newtype Identity in module Control.Monad.Identity in package `mtl`
is what you describe:
Am Sonntag, 13. Januar 2008 01:47 schrieb Brian Hurt:
So, I've been playing around with what I call the trivial monad:
module TrivialMonad where
data TrivialMonad a = M a
recover :: TrivialMonad a - a
recover (M x) = x
instance Monad TrivialMonad where
(M x) = f = f x
(M
On Jan 13, 2008 12:47 AM, Brian Hurt [EMAIL PROTECTED] wrote:
So, I've been playing around with what I call the trivial monad:
module TrivialMonad where
data TrivialMonad a = M a
Better to use newtype here; then it really is operationally equivalent
to using just a, except that it's possible
On Sat, 2008-01-12 at 16:00 -0800, Jonathan Cast wrote:
Wait, the last entry? If you're just printing out the values, then
no --- those should have been garbage collected already.
Won't they be garbage collected only after the last entry is used,
though? Since getDirectoryEntries returns a
The first question I have is it is possible to implement this guy
without wrapping the value in a constructor?
No.
The second question I have is: is there any hope of getting
something like this into the standard library?
It's there already. It's called Identity monad.
On Jan 13, 2008 12:42 AM, Andre Nathan [EMAIL PROTECTED] wrote:
On Sat, 2008-01-12 at 16:00 -0800, Jonathan Cast wrote:
Wait, the last entry? If you're just printing out the values, then
no --- those should have been garbage collected already.
Won't they be garbage collected only after the
pcre-light
A light regular expression library, using Perl 5 compatible regexes
I'm pleased to announce the first release of pcre-light. This library
provides a simple, efficient interface to PCRE regular expressions, via
either strict ByteStrings or classical
On 12 Jan 2008, at 4:42 PM, Andre Nathan wrote:
On Sat, 2008-01-12 at 16:00 -0800, Jonathan Cast wrote:
Wait, the last entry? If you're just printing out the values, then
no --- those should have been garbage collected already.
Won't they be garbage collected only after the last entry is
53 matches
Mail list logo