Thanks! I was worried about how/where would I place hClose!
On Mon, Apr 14, 2008 at 10:58 PM, Brent Yorgey [EMAIL PROTECTED] wrote:
2008/4/14 Abhay Parvate [EMAIL PROTECTED]:
Hello,
In describing the Handle type, the GHC documentation says (in the
System.IO documentation):
GHC
Bernie Pope [EMAIL PROTECTED] writes:
Of course, [unsafeShow] won't be able to print functions in any helpful way,
unless we attach source code information to
functions as well (which may be worth doing anyway?).
It might not be able to print the function's definition, but perhaps
its type?
Benjamin L. Russel wrote:
hanoi_shower ((a, b) : moves)
| null moves = ...
| otherwise == ...
Luke Palmer wrote:
More idiomatic pedantry: the way you will see most Haskellers write
this style of function is by pattern matching rather than guards:
hanoi_shower [] = ...
hanoi_shower
I usually use something like this instead:
hStrictGetContents :: Handle - IO String
hStrictGetContents h = do
s - hGetContents h
length s `seq` hClose h
return s
This guarantees the following:
1) The whole file is read before hStrictGetContents exits (could be
considered bad, but
To add to this; sharing is not always what you want; sometimes it's a
time/space trade-off and sometimes it's actually strictly worse than
not sharing.
For example:
f :: Integer - [Integer]
f x = take 1000 [x..]
sum :: [Integer] - Integer
sum = foldl' (+) 0
expensiveZero :: Integer
Yes
http://hpaste.org/6990
Am 14.04.2008 um 19:07 schrieb Adam Smyczek:
Is form based file upload supported in HTTP module (HTTP-3001.0.4)?
Adam
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Thanks Ryan, this will definitely not leak handles. I had thought about
making a strict version of hGetContents, though on a bit different lines.
My question was that since the documentation says that the semi-closed
handle becomes closed as soon as the entire contents have been read; can I
Hi all,
I've tried to install HaXml as explained in the documentation:
runhaskell Setup.hs configure
However, I get as response:
dyld: Library not loaded: GNUreadline.framework/Versions/A/GNUreadline
Referenced from: /usr/local/bin/runhaskell
Reason: image not found
Trace/BPT trap
Any
rodrigo.bonifacio [EMAIL PROTECTED] wrote:
runhaskell Setup.hs configure
dyld: Library not loaded: GNUreadline.framework/Versions/A/GNUreadline
Referenced from: /usr/local/bin/runhaskell
Reason: image not found
Trace/BPT trap
The problem is that 'runhaskell' invokes ghci (the
Is there such a beast out there?
If this were a list on some OO language I'd ask for something that created
an AST and then offered an API based around a visitor pattern.
The pre-processor (platform specific most likely, but could be cpphs of
course) would be run prior to the tool I'm
All,
Apologies for multiple listings.
It's that time again. Our growing cadre of functionally-minded north
westerners
is meeting at the
The Seattle Public Library
1000 - 4th Ave.
Seattle, WA 98104
from 18:30 - 20:00 on April 16th.
This meeting's agenda is a little more fluid, but...
- i
On Tue, Apr 15, 2008 at 4:12 PM, Brian Sniffen [EMAIL PROTECTED] wrote:
2008/4/15 Magnus Therning [EMAIL PROTECTED]:
Is there such a beast out there?
Well, there's CIL (http://manju.cs.berkeley.edu/cil/), an OCaml
library attacking the same problem. It has a very positive
reputation.
rodrigo.bonifacio wrote:
Hi all,
I've tried to install HaXml as explained in the documentation:
runhaskell Setup.hs configure
However, I get as response:
dyld: Library not loaded: GNUreadline.framework/Versions/A/GNUreadline
Referenced from: /usr/local/bin/runhaskell
Reason:
Magnus Therning schrieb:
Is there such a beast out there?
If this were a list on some OO language I'd ask for something that
created an AST and then offered an API based around a visitor pattern.
The pre-processor (platform specific most likely, but could be cpphs of
course) would be run
Ryan Ingram wrote:
I usually use something like this instead:
hStrictGetContents :: Handle - IO String
hStrictGetContents h = do
s - hGetContents h
length s `seq` hClose h
return s
A small idiomatic nitpick: When I see (length s) gets computed and thrown away
I wince at the
John Goerzen wrote:
So I have a need to write data to a POSIX named pipe (aka FIFO). Long
story involving a command that doesn't have an option to read data
from stdin, but can from a named pipe.
How about /dev/stdin?
--
Joe Buehler
___
On 4/15/08, ChrisK [EMAIL PROTECTED] wrote:
A small idiomatic nitpick: When I see (length s) gets computed and thrown
away I wince at the wasted effort. I would prefer (finiteSpine s):
On every piece of hardware I've seen, the actual calculation done by
length is basically free. Compared to
Hello,
I have an Linux executable of my Haskell library and test case. I see
there are several debuggers, e.g. Buddha, Hat, etc. Which debugger is
currently preferred for monadic (imperative) code? Thanks.
Vasili
___
Haskell-Cafe mailing list
Hello Vasili,
Wednesday, April 16, 2008, 2:53:32 AM, you wrote:
I have an Linux executable of my Haskell library and test
case. I see there are several debuggers, e.g. Buddha, Hat, etc.
Which debugger is currently preferred for monadic (imperative) code? Thanks.
i use print mainly :)
Are Haskell folks satisfied with the practical necessity of imperatively
explicitly reclaiming resources such as file handles, fonts brushes, video
memory chunks, etc? Doesn't explicit freeing of these resources have the
same modularity and correctness problems as explicit freeing of system
On 16 Apr 2008, at 00:04, Bulat Ziganshin wrote:
Hello Vasili,
Wednesday, April 16, 2008, 2:53:32 AM, you wrote:
I have an Linux executable of my Haskell library and test
case. I see there are several debuggers, e.g. Buddha, Hat, etc.
Which debugger is currently preferred for monadic
I'm using the Data.Graph.Inductive.Query.Dominators library
(http://haskell.org/ghc/docs/latest/html/libraries/fgl/Data-Graph-Inductive-Query-Dominators.html)
with GHC 6.8.2.
The library is a bit spare on comments, so I may or may not be using
it correctly.
My goal is to compute the set of nodes
On 16/04/2008, at 10:16 AM, Thomas Davie wrote:
On 16 Apr 2008, at 00:04, Bulat Ziganshin wrote:
Hello Vasili,
Wednesday, April 16, 2008, 2:53:32 AM, you wrote:
I have an Linux executable of my Haskell library and test
case. I see there are several debuggers, e.g. Buddha, Hat, etc.
When I went to make my upload of MissingH 1.0.1, Hackage rejected it,
saying:
Instead of 'ghc-options: -XPatternSignatures' use 'extensions:
PatternSignatures'
It hadn't rejected MissingH 1.0.0, even though it had the same thing.
Now, my .cabal file has this:
-- Hack because ghc-6.6 and the
On 2008.04.15 22:15:29 -0500, John Goerzen [EMAIL PROTECTED] scribbled 0.7K
characters:
When I went to make my upload of MissingH 1.0.1, Hackage rejected it,
saying:
Instead of 'ghc-options: -XPatternSignatures' use 'extensions:
PatternSignatures'
It hadn't rejected MissingH 1.0.0, even
On Tuesday 15 April 2008 10:53:03 pm Gwern Branwen wrote:
On 2008.04.15 22:15:29 -0500, John Goerzen [EMAIL PROTECTED]
scribbled 0.7K characters:
When I went to make my upload of MissingH 1.0.1, Hackage rejected it,
saying:
Instead of 'ghc-options: -XPatternSignatures' use 'extensions:
Hi,
I'm pleased to announce the first release of datapacker.
datapacker is a tool to pack files into a minimum number of CDs, DVDs,
or any other arbitrary bin. It groups file by size. It is designed
to group files such that they fill fixed-size containers (called
bins) using the minimum number
Ok; I rewrote my recursive version of hanoi,
preserving my semantics (i.e., working for lists of
length 1 or more, rather than 0 or more, to start
with) in a more Haskell-idiomatic manner; viz:
hanoi_general_recursive.hs:
hanoi :: a - a - a - Int - [(a, a)]
hanoi source using dest n
| n == 1
Your mail gives me an idea, though I am not an iota familiar with
compiler/garbage collector internals. Can we have some sort of internally
maintained priority associated with allocated objects? The garbage collector
should look at these objects first when it tries to free anything. The
objects
29 matches
Mail list logo