Thanks a lot. That is exactly what I have been looking for.
Cheers,
Martin
On Tue, 2008-08-12 at 10:28 -0700, Ryan Ingram wrote:
Latest code is on hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/MonadPrompt
There is a sample file with lots of other monads implemented
Don Stewart [EMAIL PROTECTED] writes:
You really, really want to be using rnf for this job, instead of
turning your brain into a pretzel shape.
The Pretzel being one of the lesser-known lazy, cyclic, functional data
structures.
So pretzel-brain is actually a honorific, rather than
ketil:
Don Stewart [EMAIL PROTECTED] writes:
You really, really want to be using rnf for this job, instead of
turning your brain into a pretzel shape.
The Pretzel being one of the lesser-known lazy, cyclic, functional data
structures.
So pretzel-brain is actually a honorific,
On 13 Aug 2008, at 00:44, Leif Warner wrote:
Hi all,
I'm dealing with some datatype, say:
data Invoice =
Invoice { invoiceNum:: String,
dollarAmt :: Currency,
printDate :: Date,
dueDate :: Date,
On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote:
G'day all.
Quoting Thomas Davie [EMAIL PROTECTED]:
Why is separate compilation important?
I'm a little shocked that anyone on this list should have to ask this
question. Two people have asked it now.
The simplest answer is that unless
On Wed, 13 Aug 2008, Thomas Davie wrote:
On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote:
Quoting Thomas Davie [EMAIL PROTECTED]:
Why is separate compilation important?
I'm a little shocked that anyone on this list should have to ask this
question. Two people have asked it now.
On 13 Aug 2008, at 11:10, Henning Thielemann wrote:
On Wed, 13 Aug 2008, Thomas Davie wrote:
On 13 Aug 2008, at 05:06, [EMAIL PROTECTED] wrote:
Quoting Thomas Davie [EMAIL PROTECTED]:
Why is separate compilation important?
I'm a little shocked that anyone on this list should have to ask
Andrew,
[...]
For the record, I have no problem with modules depending on each other,
so long as they only depend on their well-defined interfaces.
Finally, as chris suggests, if separate compilation is important to
you, why not have a flag in ghc -frequire-hi-boot or something?
Well,
Moving from libraries to haskell-cafe...
I wrote:
...there must be some
way to control the import and export of instances, just as we can
now control the import and export of every other kind of symbol
binding.
Henning Thielemann wrote:
For me it's most often the case that an instance is
G'day all.
Quoting C.M.Brown [EMAIL PROTECTED]:
But isn't this exactly the point I was trying to make!? The whole point,
to me, in functional programming, is that we shouldn't have to worry about
the underlying implementation.
It is not exposing an underlying implementation detail to mandate
Andrew,
But isn't this exactly the point I was trying to make!? The whole point,
to me, in functional programming, is that we shouldn't have to worry about
the underlying implementation.
It is not exposing an underlying implementation detail to mandate that
modules should have
G'day all.
Quoting Thomas Davie [EMAIL PROTECTED]:
To be honest, ghc compiles things so fast (at least on any of
my systems) that I couldn't care less if it took 10 times as long (I would
however like some added convenience for that time spent)
Have you ever compiled GHC itself? Just
On 13 Aug 2008, at 13:18, [EMAIL PROTECTED] wrote:
G'day all.
Quoting Thomas Davie [EMAIL PROTECTED]:
To be honest, ghc compiles things so fast (at least on any of
my systems) that I couldn't care less if it took 10 times as long
(I would
however like some added convenience for that time
G'day.
Quoting C.M.Brown [EMAIL PROTECTED]:
However I saw no real argument for not having cyclic inclusions. You
say we shouldn't have to spend time writing hi-boot files, and yet
you also think
that GHC should not do it automatically. So we have to restrict all
programmers to never
On Tue, 2008-08-12 at 14:13 -1000, Tim Newsham wrote:
I also noticed another issue while testing. If my program loads
the data at startup by calling loadState then all later calls to
saveState give an error:
Log: savedState.bin: openFile: resource busy (file is locked)
You're not using
E cosi' il primo incontro balnear/ricreativo degli Haskeller Italiani
si e' felicemente concluso.
Come da programma, rigidamente rispettato, abbiamo fatto il bagno e
mangiato pizza e gelato ma soprattutto ci siamo conosciuti ed abbiamo
discusso di tutto e di piu', prevalentemente Haskell (folds,
On Wed, 13 Aug 2008, Yitzchak Gale wrote:
Why is it that when I say
import Control.Monad.Error (throwError, runErrorT)
there is no way to prevent also getting a surprising Monad Either
instance? Never mind how things should have been named
in Control.Monad.Error - that's the way it is right
---
Haskell Weekly News
http://sequence.complete.org/hwn/20080813
Issue 81 - August 13, 2008
---
Welcome to issue 81 of HWN, a newsletter covering
I found an old lib for it:
http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html
Hoogle turns up nothing, though.
--
_jsn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hello,
The Haskell'98 report does not specify if/how recursive modules should
work. I wrote a paper a long time ago that formalizes and implements
this feature (http://www.purely-functional.net/yav/publications/modules98.pdf).
I very much doubt that separate compilation is much of a problem in
2008/8/13 Jason Dusek [EMAIL PROTECTED]:
I found an old lib for it:
http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html
Hoogle turns up nothing, though.
That don't sound very useful... Maybe when we only had String it was
much more performant for big transfert, but now
On 2008 Aug 13, at 15:01, Chaddaï Fouché wrote:
2008/8/13 Jason Dusek [EMAIL PROTECTED]:
I found an old lib for it:
http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html
Hoogle turns up nothing, though.
That don't sound very useful... Maybe when we only had String it was
Chaddaï Fouché [EMAIL PROTECTED] wrote:
Maybe when we only had String it was much more performant for
big transfert, but now we can recode this in one short line of
ByteString code and get the same performance as C.
Oh? Using lazy ByteString?
--
_jsn
On 2008 Aug 13, at 15:04, Brandon S. Allbery KF8NH wrote:
On 2008 Aug 13, at 15:01, Chaddaï Fouché wrote:
2008/8/13 Jason Dusek [EMAIL PROTECTED]:
I found an old lib for it:
http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html
Hoogle turns up nothing, though.
That don't
2008/8/13 Brandon S. Allbery KF8NH [EMAIL PROTECTED]:
I should clarify: what sendfile() is supposed to optimize isn't writing
large strings, or even the user-kernel roundtrips; it's an optimization to
the kernel network stack (network buffer management, to be specific). Web
servers use it
Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
I should clarify: what sendfile() is supposed to optimize
isn't writing large strings, or even the user-kernel
roundtrips; it's an optimization to the kernel network stack
(network buffer management, to be specific). Web servers use
it to
Ah, that would be a bug in older ByteString implementations, that were a
bit incautious about closing handles. This example works for me with
bytestring-0.9.1.0
Yup, thank you Don and Duncan for pointing this out. I updated
my bytestring library and the test case no longer fails. However,
-
雅虎邮箱,您的终生邮箱!___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Bulat Ziganshin wrote:
Hello Andrew,
Wednesday, August 6, 2008, 10:09:43 PM, you wrote:
Here's the thing though... How do I get it so that Foo Int and Foo
Double produce slightly different strings when printed?
instnace Show (Foo Int) ...
instnace Show (Foo Double) ...
...WHY
The naming of cats is a difficult matter...
Ahem. So as you may have noticed, we seem to have a profusion of
packages all called binary or something dangeriously similar. There's
also several MD5 packages. I could point out a few others. So what I'm
wondering is... Do we have a formal
No problem. Let me know what you end up doing with it, or if you have
any questions!
-- ryan
On Tue, Aug 12, 2008 at 11:32 PM, Martin Hofmann
[EMAIL PROTECTED] wrote:
Thanks a lot. That is exactly what I have been looking for.
Cheers,
Martin
On Tue, 2008-08-12 at 10:28 -0700, Ryan
Should the file be closed when the last byte is read (in this
case its definitely reading all four bytes) or when the first
byte after that is read (in this case it probably doesn't
attempt to read more than 4 bytes)?
I'll answer my own question. Both Prelude.readFile and
newsham:
Should the file be closed when the last byte is read (in this
case its definitely reading all four bytes) or when the first
byte after that is read (in this case it probably doesn't
attempt to read more than 4 bytes)?
I'll answer my own question. Both Prelude.readFile and
Do we have a formal convention for the naming of
packages and/or the naming of the modules they contain?
There is a recommended set of categories and in general I believe
library authors try and follow the previously established names.
How are name
collisions supposed to be avoided?
In
Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
Right. I intended that to be a heads-up in both directions:
it is not simply a library convenience function, so one needs
to think about when to use it. In particular, it's possible
that overuse of sendfile() in the wrong circumstances will
On 2008 Aug 13, at 18:25, Jason Dusek wrote:
Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
Right. I intended that to be a heads-up in both directions:
it is not simply a library convenience function, so one needs
to think about when to use it. In particular, it's possible
that overuse of
It looks like there could be a Haskell sendfile for Windows as
as well *NIX. However, the *NIX implementations are:
:: File Descriptor - File Descriptor - IO ()
while the Windows version is:
:: File Descriptor - Socket - IO ()
A cross platfrom implementation would cover the case we
On Wed, Aug 13, 2008 at 03:40:43PM -0700, Jason Dusek wrote:
A cross platfrom implementation would cover the case we most
care about -- writing services that pass static files back to
clients -- but would have to cut some functionality from the
*NIX sendfile().
There isn't a standard
John Meacham [EMAIL PROTECTED] wrote:
There isn't a standard unix sendfile, while a few different
ones have functions called 'sendfile', they have different
meanings/prototypes in general. If 'sendfile(2)' is going to
be exposed, it should be in a low level platform specific
library, however,
I'm running into problems with generating an arbitrary function of
type Double - Double. Specifically, the following code:
{-# LANGUAGE PatternSignatures #-}
import Test.QuickCheck
import Text.Show.Functions
prop_ok (f :: Double - Double) =
f (-5.5) `seq` True
prop_bug (f :: Double -
On Wed, Aug 13, 2008 at 5:02 PM, Tim Newsham [EMAIL PROTECTED] wrote:
However, I think probably the real blame here should probably go
to Data.Binary which doesn't attempt to check that it has consumed
all of its input after doing a decode. If decode completes
and there is unconsumed data,
The bug is in the variant function in QuickCheck. I replaced
variant :: Int - Gen a - Gen a
variant v (Gen m) = Gen (\n r - m n (rands r !! (v+1))
where
rands r0 = r1 : rands r2 where (r1, r2) = split r0
with
variant :: Int - Gen a - Gen a
variant v (Gen m) = Gen (\n r - m n (rands r !!
Ok, surely at least everyone must agree that this is a bug:
force :: Word8 - IO Word8
force x = print x return x
-- force = return . (`using` rnf)
main = do
d - force = decodeFile stateFile
encodeFile stateFile d
where stateFile = 1word32.bin
test8.hs: 1word32.bin:
newsham:
Ok, surely at least everyone must agree that this is a bug:
force :: Word8 - IO Word8
force x = print x return x
-- force = return . (`using` rnf)
main = do
d - force = decodeFile stateFile
encodeFile stateFile d
where stateFile = 1word32.bin
So am I understanding you correctly that you believe this is not
a bug? That the use Data.Binary.decodeFile function leaks a file
descriptor and this is proper behavior?
I still don't understand your explanation of how isEmpty can
return True without having read to EOF. The ByteString
45 matches
Mail list logo