On 7/6/07, Lukas Mai <[EMAIL PROTECTED]> wrote:
I don't see how this solves the problem. AFAICS acceptLoop never returns
and sok is never closed. On the other hand, my program doesn't need a
liveOpCount because the subthreads take care of themselves. It's just the
accept loop I need to break some
Am Freitag, 6. Juli 2007 02:13 schrieb Thomas Conway:
> Here's my solution:
>
> acceptLoop sok reqChan = do
> req <- Network.Socket.accept sok
> atomically (writeTChan reqChan req)
> acceptLoop sok reqChan
>
> mainLoop reqChan quitVar liveOpCountVar = do
> action <- atomically (qui
On Fri, Jul 06, 2007 at 10:56:43AM +1000, Donald Bruce Stewart wrote:
> andrewcoppin:
> > Jonathan Cast wrote:
> > >On Thursday 05 July 2007, Andrew Coppin wrote:
> > >
> > >>...OK, anybody have a solution that works in Haskell 98?
> > >>
> > >
> > >Rank-2 types are perhaps /the/ most common,
andrewcoppin:
> Jonathan Cast wrote:
> >On Thursday 05 July 2007, Andrew Coppin wrote:
> >
> >>...OK, anybody have a solution that works in Haskell 98?
> >>
> >
> >Rank-2 types are perhaps /the/ most common, widely accepted extension to
> >Haskell 98, after the approved addendum for FFI and
Michael Vanier cs.caltech.edu> writes:
>
> I'm sure this has been done a hundred times before, but a simple
generalization of foldl just
> occurred to me and I wonder if there's anything like it in the standard
libraries (I couldn't find
> anything). Basically, I was trying to define the "any
drtomc:
> On 7/6/07, Lukas Mai <[EMAIL PROTECTED]> wrote:
> >Hello, cafe!
>
> Have you been reading my mind? See the other recent Cafe thread (um,
> titled something about System.Exit).
>
> Here's my solution:
...
If you've got small examples illustrating how to use the various
concurrency abst
On 7/6/07, Lukas Mai <[EMAIL PROTECTED]> wrote:
Hello, cafe!
Have you been reading my mind? See the other recent Cafe thread (um,
titled something about System.Exit).
Here's my solution:
acceptLoop sok reqChan = do
req <- Network.Socket.accept sok
atomically (writeTChan reqChan req)
p.f.moore:
> On 05/07/07, Jonathan Cast <[EMAIL PROTECTED]> wrote:
> >Can't say I agree. I've been learning Python, and have been very
> >un-impressed
> >so far with its library coverage, which I would rate no better than (in
> >terms
> >of the POSIX bindings, worse than) Haskell.
>
> It probab
I am a total quickcheck noob. Is there a way to find out what predicate
test "" is, below?
Also, is there a way I can ask quickcheck to test lists of various built
in types, not just Int?
***
Falsifiable, after 4 tests:
[1]
*Recursion> testMyBreak
Falsifiable, after 1 tests:
[-1,1,2]
Hello, cafe!
I have the following code (paraphrased):
...
forkIO spin
...
spin = do
(t, _) <- accept s -- (*)
forkIO $ dealWith t -- (**)
spin
My problem is that I want to stop spin from another thread. The "obvious"
solution would be to throw it an exception. However, that leaks
On Thursday 05 July 2007, Andrew Coppin wrote:
This version works (I think). Also, using this syntax may make the
distinction between existential constructors and rank-2 constructors a little
clearer.
*AlgoRLE> run decodeRLEb1 $ start () $ encodeRLEb [1, 2, 3]
([1],PState {state = (), source
Hi Andrew,
On Wed, Jul 04, 2007 at 07:26:48PM +0100, Andrew Coppin wrote:
> >
> >Writing documentation for libraries is one way in which ordinary
> >Haskell users can really contribute to the Haskell community. It’s not
> >hard to do (grab the Darcs repo, type away), and it’s widely appreciated
On Thursday 05 July 2007, Andrew Coppin wrote:
> Jonathan Cast wrote:
> > On Thursday 05 July 2007, Andrew Coppin wrote:
> >> ...OK, anybody have a solution that works in Haskell 98?
> >
> > Rank-2 types are perhaps /the/ most common, widely accepted extension to
> > Haskell 98, after the approved
-- This is probably line-wrapped horribly...
module Process
(
Source (..),
PState (), start,
Process (run),
get_state, set_state, alt_state,
get, eof,
pure, count, many,
stack
)
where
class Source src where
empty :: src x -> Bool
fetch :: src x ->
>
>> (Bonus points for being able to parse ASN.1 and generate appropriate
>> Haskell datatypes & serialization primitives automatically :-) )
>
> I think there's at least an ASN.1 definition in the crypto library.
> Dominic might be able to enlighten us on that.
>
No bonus points I'm afraid. Th
AC> For the Nth time... The amount of data processed by parser1 needs
AC> to depend on the amount of data processed by parser2. (The amount
AC> of data output by each parser is very nontrivially related to the
AC> amount of data consumed.)
What about lazyness? Let parser1 process ALL the data and
On Jul 5, 2007, at 9:52 AM, Paul Moore wrote:
You're changing the problem from finding a Haskell library (which only
needs to be installed on the development machine at compile time) to
finding a 3rd party utility, which has to be installed at runtime
...
Not a good trade-off.
The intersecti
Jonathan Cast wrote:
Andrew:
By the way, could you share your definition of Stack with us? It isn't at all
clear to me how stacked actually decides to terminate the underlying parser.
Yeah, I'll post the complete source here in a little while. I think
that's probably the only way anybody
Jonathan Cast wrote:
On Thursday 05 July 2007, Andrew Coppin wrote:
...OK, anybody have a solution that works in Haskell 98?
Rank-2 types are perhaps /the/ most common, widely accepted extension to
Haskell 98, after the approved addendum for FFI and the draft addendum for
hierarchica
Andrew:
By the way, could you share your definition of Stack with us? It isn't at all
clear to me how stacked actually decides to terminate the underlying parser.
Jonathan Cast
http://sourceforge.net/projects/fid-core
http://sourceforge.net/projects/fid-emacs
___
On Thursday 05 July 2007, Andrew Coppin wrote:
> Jonathan Cast wrote:
> > On Wednesday 04 July 2007, Andrew Coppin wrote:
> >> Anybody have a solution to this?
> >
> > newtype Parser state x y
> > = Parser (forall src. Source src => (state, src x) -> (state, src x,
> > y))
>
> ...OK, anybody have
Dougal Stanton wrote:
do
(hin, hout, herr, ph) <- runInteractiveProcess cmd args Nothing Nothing
forkIO $ hPutStr hin content >> hClose hin
out <- hGetContents hout
return (ph, out)
which seems to require threading. If I compile without, it will hang
indefinitely, I presume deadlocked.
On 5 Jul 2007, at 18:35, Chung-chieh Shan wrote:
[EMAIL PROTECTED] wrote in article
<[EMAIL PROTECTED]> in
gmane.comp.lang.haskell.cafe:
Conor McBride has posed an interesting problem:
implement constructors
P v for embedding pure values v
Ofor holes
f :$ a
On Thu, Jul 05, 2007 at 06:08:45PM +0100, Duncan Coutts wrote:
> On Thu, 2007-07-05 at 17:51 +0100, Neil Mitchell wrote:
> >
> > > - Found that on hackage, downloaded and built OK. Lots of scary
> > > warnings about happy, greencard etc, not being found during configure,
> > > but let's go on.
> >
[EMAIL PROTECTED] wrote in article <[EMAIL PROTECTED]> in
gmane.comp.lang.haskell.cafe:
> Conor McBride has posed an interesting problem:
> >implement constructors
> > P v for embedding pure values v
> > Ofor holes
> > f :$ a for application, left-associative
> >
Malcolm Wallace wrote:
I can't help thinking that all you really want to do is parse the same
data twice, through an intermediate representation. That only requires
you to feed the result of one parse into a top-level call to a different
parser. For instance:
this = do
tmp <- parser1
Jonathan Cast wrote:
On Wednesday 04 July 2007, Andrew Coppin wrote:
Anybody have a solution to this?
newtype Parser state x y
= Parser (forall src. Source src => (state, src x) -> (state, src x, y))
...OK, anybody have a solution that works in Haskell 98?
Definition of monad
On Thu, 2007-07-05 at 17:51 +0100, Neil Mitchell wrote:
> Hi
>
> It's not a great experience now, but hopefully things are moving in
> the right direction.
>
> > - Found crypto 3.0.3 on hackage.
> > - Tried to build, it depends on NewBinary
>
> Cabal-install is intended to remove this problem, s
On Thu, 2007-07-05 at 17:39 +0100, Paul Moore wrote:
> I see you've already responded, and we're in broad agreement. So I
> won't labour the point. It's an infrastructure issue rather than a
> technical one, and it *will* improve. What will be interesting is how
> much the generally lousy Windows e
On 05/07/07, Neil Mitchell <[EMAIL PROTECTED]> wrote:
> - But no simple examples, and the haddoc docs show APIs, but not usage
examples!
Complain to the author.
Yes, that's completely unrelated to library availability issues. I got
off the topic, in all my ranting. Sorry.
Part of the proble
On Thu, Jul 05, 2007 at 09:41:23AM -0700, Dave Bayer wrote:
There are people who claim with a straight face that they migrated to OS X
primarily to use TextMate
http://www.textmate.com
Presumably you mean http://macromates.com/ ?
Phil
--
http://www.kantaka.co.uk/ .oOo. public key: h
On 05/07/07, Dave Bayer <[EMAIL PROTECTED]> wrote:
How's this, only one line is specific to your problem:
[...]
> md5 <- doShell "md5 -q md5.hs"
Doesn't work on my (Windows) PC, where I have no md5 command
available. While I agree in theory with the idea of combining focused
tools, it's a
Hi
It's not a great experience now, but hopefully things are moving in
the right direction.
- Found crypto 3.0.3 on hackage.
- Tried to build, it depends on NewBinary
Cabal-install is intended to remove this problem, so that you can say
"i want crypto" and it gets everything that requires.
On Jul 5, 2007, at 8:00 AM, Paul Moore wrote:
It probably depends on your perspective. I've found lots of tasks that
would be a simple library call in Python, but which require me to
write the code myself in Haskell. Examples:
* Calculate the MD5 checksum of a file
How's this, only one line
On 05/07/07, Paul Moore <[EMAIL PROTECTED]> wrote:
The need I had for these is no longer current, but sometime I'll try
an experiment and see how easy it is, on a relatively clean Windows
box with just GHC installed, to grab and use these libraries.
Just for fun I had a go with crypto:
- Found
Hello Paul,
Thursday, July 5, 2007, 8:07:34 PM, you wrote:
> note: with Python, I'm used to 3rd party modules being available as
> Windows installer packages - does the concept of an installable binary
> for something like MissingH, which I can just install and use, make
> sense for a compiled la
On Thu, 2007-07-05 at 17:07 +0100, Paul Moore wrote:
> On 05/07/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote:
> > > * Gzip compress a data stream
> > zlib
> >
> > > * Send an email
> > > * Parse an ini file
> > >> The one thing off the top of my head that Python had was Base64, but
> > >> that's
On 05/07/07, Bulat Ziganshin <[EMAIL PROTECTED]> wrote:
> * Gzip compress a data stream
zlib
> * Send an email
> * Parse an ini file
>> The one thing off the top of my head that Python had was Base64, but that's
MissingH
> * Calculate the MD5 checksum of a file
crypto
Thanks.
The need I had
Hello Paul,
Thursday, July 5, 2007, 7:00:46 PM, you wrote:
> * Gzip compress a data stream
zlib
> * Send an email
> * Parse an ini file
>> The one thing off the top of my head that Python had was Base64, but that's
>> 20
MissingH
> * Calculate the MD5 checksum of a file
crypto
--
Best reg
On 05/07/07, Jonathan Cast <[EMAIL PROTECTED]> wrote:
Can't say I agree. I've been learning Python, and have been very un-impressed
so far with its library coverage, which I would rate no better than (in terms
of the POSIX bindings, worse than) Haskell.
It probably depends on your perspective.
On Thursday 05 July 2007, Thomas Conway wrote:
> I was explaining Haskell to a perl/python hacking friend recently and
> characterized things thus:
>
> Perl is a horrible language with fantastic libraries.
> Haskell is a fantastic language with horrible libraries.
>
> Actually, many of the librarie
Hi Haskellers,
It seems that profiling and threading are not supported at the same
time in GHC6.6. At least, it objects to using both the flags at the
same time, and there's a Trac entry for that issue.
So I just wanted to be sure that I really need threading. I'm passing
text through some filte
On Thursday 05 July 2007, [EMAIL PROTECTED] wrote:
> I believe the answer to this question is NO. That means, (delimited)
> continuations expose the fundamental limitation of monadic
> transformers.
I suppose this is a bit disheartening, but I suppose it's also good to know I
wasn't totally off t
FWIW,
I implemented the STM based solution, and it works a treat. It's less
of a hack than the version where I got the child thread to send a
SIGINT. ;-)
T.
--
Dr Thomas Conway
[EMAIL PROTECTED]
Silence is the perfectest herald of joy:
I were but little happy, if I could say how much.
_
(b) i like my combinator grammars to be reversible, so that a single
grammar specification can be used for both parsing and
unparsing/pretty-printing. that means i have to define the
details myself anyway.
the latest such experiment is not necessarily the simplest variant,
for in
Hi Oleg
On 5 Jul 2007, at 07:15, [EMAIL PROTECTED] wrote:
Conor McBride has posed an interesting problem:
implement constructors
P v for embedding pure values v
Ofor holes
f :$ a for application, left-associative
and an interpreting function
emmental
Andrew Coppin <[EMAIL PROTECTED]> wrote:
> My goal is to be able to stack multiple parsers one on top of the
> other - but be able to *change* the stack half way through parsing if
> needed.
>
> Essentially, I have the "stacked" function, where if I do
>
> x <- stacked foo parser1 bar parser2
Philip Armstrong wrote:
> genericLength :: (Num i) => [b] -> i
> genericLength []= 0
> genericLength (_:l) = 1 + genericLength l
>
> So genericLength is lazily building up unevaluated (+) expressions and
> running out of stack space.
>
> Is there a good reason for genericL
The ZFS library contains the most up-to-date implementation of the CC
monad and the transformer. I have a few other versions scattered
around, but they are probably not relevant. I found the CC_FrameT.hs
to be the fastest one.
> Is that you can think of normal continuations as delimited
> continu
On Thu, Jul 05, 2007 at 10:49:17AM +0400, Miguel wrote:
R> Another interesting thing I've discovered is:
Prelude>> length [1..100]
R> 100
Prelude>> Data.List.genericLength [1..100]
R> *** Exception: stack overflow
R> Maybe there is something wrong with Integer ?
No, there is some
Can you do dropWhile in terms of foldr? I don't see how.
If you are really keen, you might want to try altering the "working
backwards with tuples" version into one which is properly lazy (many
people who read the paper pointed out the omission).
you might want to mention the story of the p
drtomc:
> I was explaining Haskell to a perl/python hacking friend recently and
> characterized things thus:
>
> Perl is a horrible language with fantastic libraries.
> Haskell is a fantastic language with horrible libraries.
>
> Actually, many of the libraries that exist for Haskell *are*
> fant
On Wed, Jul 04, 2007 at 11:16:20PM -0700, Stefan O'Rear wrote:
> The documentation says:
> | Computation exitWith code throws ExitException code. Normally this
> | terminates the program, returning code to the program's caller. Before
> | the program terminates, any open or semi-closed handles are
I was explaining Haskell to a perl/python hacking friend recently and
characterized things thus:
Perl is a horrible language with fantastic libraries.
Haskell is a fantastic language with horrible libraries.
Actually, many of the libraries that exist for Haskell *are*
fantastic, it's just that H
On Thu, Jul 05, 2007 at 08:50:42AM +1000, Donald Bruce Stewart wrote:
[useful stuff]
So, in fact pretty much everything I was looking for exists, in some
form or other!
It's just a bit hard to find at the moment, perhaps because none of
this stuff is regarded as 'core Haskell' by any of the tuto
55 matches
Mail list logo