Donald Bruce Stewart wrote:
pete-expires-20070513:
When using readFile to process a large number of files, I am exceeding
the resource limits for the maximum number of open file descriptors
This is very annoying - I can't see any good reason why file descriptors
should run out (before
On Wed, Mar 14, 2007 at 06:05:31PM -0700, David Brown wrote:
Greg Fitzgerald wrote:
What we need is a library for a readonly filesystem. That is, all
the same functions but pure. I believe you could make this readonly
library by wrapping each readonly I/O function with
the usual caveats about unsafePerformIO apply, so perhaps you wouldn't want
to use this in a database library..
Indeed. This is quite problematic, from the practical point of view of
making resources difficult to control (cf. another thread of file
handle leakage), to the theoretical point
On 3/15/07, Steve Downey [EMAIL PROTECTED] wrote:
EOk, i'm trying to write down, not another monad tutorial, because I
don't know that much yet, but an explication of my current
understanding of monads.
But before I write down something that is just flat worng, I thought
I'd get a cross check.
2007/3/15, S. Alexander Jacobson [EMAIL PROTECTED]:
...
Any opinions on these issues would be very appreciated.
...
Maybe the relational database system CoddFish which uses HList
provides some insights:
http://haskell.org/haskellwiki/Libraries_and_tools/Database_interfaces/CoddFish
They also
Ketil Malde:
Perhaps this is an esoteric way, but I think the nicest approach is to
parse into a strict structure. If you fully evaluate each Email (or
whatever structure you parse into), there will be no unevaluated thunks
linking to the file, and it will be closed.
Not necessarily so,
On 3/14/07, Pete Kazmier [EMAIL PROTECTED] wrote:
When using readFile to process a large number of files, I am exceeding
the resource limits for the maximum number of open file descriptors on
my system. How can I enhance my program to deal with this situation
without making significant changes?
Matthew Brecknell wrote:
Ketil Malde:
Perhaps this is an esoteric way, but I think the nicest approach is to
parse into a strict structure. If you fully evaluate each Email (or
whatever structure you parse into), there will be no unevaluated thunks
linking to the file, and it will be
Not necessarily so, since you are making assumptions about the
timeliness of garbage collection. I was similarly sceptical of Claus'
suggestion:
Claus Reinke:
in order to keep the overall structure, one could move readFile backwards
and parseEmail forwards in the pipeline, until the two meet.
claus.reinke:
Not necessarily so, since you are making assumptions about the
timeliness of garbage collection. I was similarly sceptical of Claus'
suggestion:
Claus Reinke:
in order to keep the overall structure, one could move readFile backwards
and parseEmail forwards in the pipeline,
Ketil Malde wrote:
Bertram Felgenhauer wrote:
type Subject = String
data Email = Email {from :: From, subject :: Subject} deriving Show
data Email = Email {from :: !From, subject :: !Subject} deriving Show
...except that From and Subject are Strings, and thus the strictness
annotation
On the one hand, in the standard libraries there are functions like
readFile, getContents, hGetContents which read a file lazily. This is
often a nice feature, but sometimes lead to unexpected results, say when
reading a file and overwriting it with modified contents. Unfortunately
the standard
Henning Thielemann wrote:
On the one hand, in the standard libraries there are functions like
readFile, getContents, hGetContents which read a file lazily. This is
often a nice feature, but sometimes lead to unexpected results, say when
reading a file and overwriting it with modified contents.
lemming:
On the one hand, in the standard libraries there are functions like
readFile, getContents, hGetContents which read a file lazily. This is
often a nice feature, but sometimes lead to unexpected results, say when
reading a file and overwriting it with modified contents. Unfortunately
http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AHandle
GHC note: a Handle will be automatically closed when the garbage
collector detects that it has become unreferenced by the program.
However, relying on this behaviour is not generally recommended: the
Thanks! Serious food for thought.
Ten years of object oriented brainwashing to undo :)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
That said, N and R are indeed categories; however, considering them as
categories should be carefully interlaced with your intuitions about
them as types.
I haven't formally checked it, but I would bet that this endofunctor
over N, called Sign, is a monad:
Sign x = x + x
Pos = injectLeft
Neg
i want to start learning Haskell and willing to master it :-) i have
done some Common Lisp from http://www.gigamonkeys.com/book/. so i know
what are functions, variables, etc. BUT i have never done any real
life programmming or any kind of software development.
in my country no Haskell books
Hi Arnuld,
It's certainly possible. I'm new to the language too and learning it much
the same way. It sounds like you don't have a lot of experience programming.
I think this is an asset, not a liability. I would be interested in what
concepts are the hardest to understand so the community can
Yet another Haskell Tutorial is the way I learned it. I find that subscribing
to the mailing lists and reading the tutorial material is generally speaking
enough.
On Thursday 15 March 2007 14:30:03 arnuld wrote:
i want to start learning Haskell and willing to master it :-) i have
done some
arnuld wrote:
i want to start learning Haskell and willing to master it :-)
Also check out the Wikibook at
http://en.wikibooks.org/wiki/Programming:Haskell
Do call back here if you need help. The Wikibook people would also
appreciate feedback on what you found easy or difficult to
Hi.
I'm trying to write some code which involves lots of matrix multiplications,
but whenever I do too many, I get stack overflows (in both GHCi 6.4.2, and
Hugs May 2006). The following code exhibits the problem.
import List (transpose)
u . v = sum $ zipWith (*) u v
a * b = multMx a
Ok, so I'm inching closer to understanding monads, and this question
popped up today. Consider the following 2 declarations:
data Foo a = Bar a
data (Ord a) = Baz a = Bah a
Note that both of these have kind * - *. However, Baz could never be
an instance of monad, because there is a restriction
On 3/15/07, arnuld [EMAIL PROTECTED] wrote:
i want to start learning Haskell and willing to master it :-) i have
done some Common Lisp from http://www.gigamonkeys.com/book/. so i know
what are functions, variables, etc. BUT i have never done any real
life programmming or any kind of software
This is all a good idea, but I've found that I've never learned nearly
as much as when I started bashing out some code. So I highly recommend
starting up some project that's interesting to you too.
Hang out in #haskell in IRC (freenode). That's probably the best
resource you'll ever find when
I haven't formally checked it, but I would bet that this endofunctor
over N, called Sign, is a monad:
Just to be picky a functor isn't a monad. A monad is a triple consisting of a
functor and 2 natural transformations which make certain diagrams commute.
If you are looking for examples, I
Hello Sebastian,
Friday, March 16, 2007, 12:15:09 AM, you wrote:
So here's the strategy:
1. Read tutorials
2. When you get stuck, ask on #haskell
3. Goto 1
(yes I deliberately wrote an imperative algorithm using gotos to
describe how to learn Haskell, and I found it amusing)
knowledge -
The most common kind of primitive recursive function I find myself
writing these days is a variation on the theme of merging two sorted lists.
You can see some examples in my Ranged Sets library at
http://ranged-sets.sourceforge.net/. For instance:
-- | Set union for ranged sets. Infix
I'm trying to write some code which involves lots of matrix multiplications,
but whenever I do too many, I get stack overflows (in both GHCi 6.4.2, and
Hugs May 2006). The following code exhibits the problem.
..
I tried to fix the problem using seq, as follows:
iterate' f x = x : seq x'
Thanks for keeping me honest ;)
On 3/15/07, Dominic Steinitz [EMAIL PROTECTED] wrote:
I haven't formally checked it, but I would bet that this endofunctor
over N, called Sign, is a monad:
Just to be picky a functor isn't a monad. A monad is a triple consisting of a
functor and 2 natural
Andrew Wagner wrote
data Foo a = Bar a
data (Ord a) = Baz a = Bah a
Note that both of these have kind * - *. However, Baz could never be
an instance of monad, because there is a restriction on the types it
can operate on.
There is a wide-spread opinion that one ought not to give context to
Sebastian Sylvan wrote:
So here's the strategy:
1. Read tutorials
2. When you get stuck, ask on #haskell
3. Goto 1
(yes I deliberately wrote an imperative algorithm using gotos to
describe how to learn Haskell, and I found it amusing)
It is just a standard transformation away from a
Brian,
I had this exact problem, and I found this approach to work wonderfully:
http://pupeno.com/2006/12/17/unstable-packages-on-ubuntu/
Chad
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
[Please follow-up to [EMAIL PROTECTED]
S. Alexander Jacobson wrote:
HLists require you to define Labels and basically only use label
values that are themselves either scalar or HLists.
...
With SYB you create field labels using newtype (or data) declarations
e.g.
data Salary = S
DavidA wrote:
I'm trying to write some code which involves lots of matrix multiplications,
but whenever I do too many, I get stack overflows (in both GHCi 6.4.2, and
Hugs May 2006).
By placing a couple of strictness annotations, your test' gives the
expected answer (given some time) on Hugs.
35 matches
Mail list logo