[Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Trent W. Buck
"Neil Mitchell" <[EMAIL PROTECTED]> writes:
> The darcs 2.0 announcement read like an obituary

I don't know why, but a lot of people I spoke to seemed to have that
impression, and I essentially had to wave changelogs under their face to
convince them that darcs was still being worked on *at all*.  I had to
point out that it was a *release* announcement -- how could a dead
project have a new major version?

Perhaps a chirpy journalism major should be writing vapidly up-beat
announcement posts, denying even the possibility of problems :-P

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Derek Elkins
On Sat, 2008-08-02 at 23:40 -0700, Jason Dusek wrote:
> Derek Elkins <[EMAIL PROTECTED]> wrote:
> > [id,id] is the counit.
> > [id,id] : C+C -> C
> > Given a function f : A+B -> C there exists a unique function
> > f* : (A,B) -> (C,C) that is a pair of functions
> > h : A -> C and k : B -> C such that
> > [id,id] . h+k = f.
> 
>   This f is what I have labelled [f,g] (or f+g) in the diagram I
>   linked to, right?

Yes. [f,g] is the right notation.  The statement of the universal arrow,
however, uses -any- arrow A+B -> C so I thought it best not to expose
any of its structure.  Anyway, showing that it has such structure is
what proving uniqueness of f* does.

>   In that case h and k are just f and g, respectively, and the
>   unique arrow that goes from A+B to C+C is f+g -- but that
>   would make C+C just the same as C.

The unique arrow is f* : (A,B) -> (C,C), -not- an arrow A+B -> C+C.  An
arrow f : A+B -> C does -not- uniquely determine an arrow A+B -> C+C
such that the universal arrow diagram commutes.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Don Stewart
trentbuck:
> "Neil Mitchell" <[EMAIL PROTECTED]> writes:
> > The darcs 2.0 announcement read like an obituary
> 
> I don't know why, but a lot of people I spoke to seemed to have that
> impression, and I essentially had to wave changelogs under their face to
> convince them that darcs was still being worked on *at all*.  I had to
> point out that it was a *release* announcement -- how could a dead
> project have a new major version?

The 2.0 release should have been a triumph.
 
That announce was a strategic error of pretty immense proportions. And
as a result, it's basically impossible to justify work on the project to
outsiders, or new transition to darcs on projects. And it made those who
recommended darcs look foolish. The once shining "smart dvcs" brand of
darcs has been trampled.

To really turn things around -- which maybe could be done -- we'd need
new leadership, and an aggressive change in project direction, to
counter the slide. And that's a *lot* of work: full time, active project
leadership, lots of public activity, clear goals, clear direction. It
could make someone famous. Do we have a young turk to take up the challenge?

And all this delay while the git juggernaut takes over the internet.

> Perhaps a chirpy journalism major should be writing vapidly up-beat
> announcement posts, denying even the possibility of problems :-P
  
I think Eric's doing language processing, not journalism ;)

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Brandon S. Allbery KF8NH


On 2008 Aug 3, at 1:17, Trent W. Buck wrote:


"Neil Mitchell" <[EMAIL PROTECTED]> writes:

The darcs 2.0 announcement read like an obituary


I don't know why, but a lot of people I spoke to seemed to have that
impression, and I essentially had to wave changelogs under their  
face to


That would be this part in particular:
Unfortunately, it is also a rather labor-intensive process, and due  
to a lack of contributors, we've moving to a more streamlined  
process. Starting with the darcs 2.0.0 release, there will be just  
one central branch of darcs and only one maintainer: for now this is  
me, David Roundy.  Moreover, I will be attempting to act as a much  
lower-profile maintainer than we've had previously. I will not be  
reading bug reports, reading the darcs-users email list or even the  
darcs-devel mailing list. I will only be reviewing patches that are  
contributed.


Which is pretty much saying "darcs 2 has moved to maintenance mode".   
And this:
Darcs 2.0.0 contains some performance regressions when running with  
large repositories. It is possible that these regressions will be  
sufficient to prevent its effective use in some projects. If this  
describes your project--and the only way to know is to try it--then  
I recommend considering either switching to a different revision  
control system, or helping us to improve darcs. The former is  
certainly the easier path.
didn't help.  All in all, it sounded an awful lot like "here's our  
final release, find new maintainers if you want it to continue" ---  
followed by an ominous silence from the darcs camp.


(Hm, I feel a blog rant coming on.)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Jason Dusek
Derek Elkins <[EMAIL PROTECTED]> wrote:
> Jason Dusek wrote:
> > the unique arrow that goes from A+B to C+C is f+g -- but
> > that would make C+C just the same as C.
>
> The unique arrow is f* : (A,B) -> (C,C), -not- an arrow A+B ->
> C+C.  An arrow f : A+B -> C does -not- uniquely determine an
> arrow A+B -> C+C such that the universal arrow diagram
> commutes.

  Yes, I have confused my meaning a bit. +(f*) is also unique,
  and that was the arrow I was thinking of.

  So, we have f* : (A, B) -> (C, C), comprising h and k, so I
  am not sure sure how + will act on it. As I've seen with + so
  far, it works like this on arrows:

+((A -> C), (B -> C))  |->  A+B -> C

  So, for example, +(f, g) |-> [f,g] -- so what is f* made of?
  This is what seems to be happening:

+((A, B) -> (C, C))  |->  A+B -> C+C

  So how are h and k paired? Their pairing puts them CxC but
  seemingly in a different way from the way I've paired f and g.

-- 
_jsn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Brainstorming on how to parse IMAP

2008-08-03 Thread Donn Cave
On Sat, 02 Aug 2008 21:04:28 -0500
John Goerzen <[EMAIL PROTECTED]> wrote:
...
> The braces mean that the given number of octets follows after the CRLF
> at the end of the given line.  We could even see:
> 
> A283 SEARCH {4} {21}
> TEXTstring not in mailbox

I don't think it's quite that bad.  The literal count must immediately
precede the value -- {4}\r\nTEXT -- the way I read it.

I think most servers use this mechanism for mail message data only, but
seems to me there's one out there that may occasionally slip a literal
into LIST results.

> 1) Ideally I could parse stuff lazily.  I have tried this with FTP and
> it is more complex than it seems at first, due to making sure you never,
> never, never consume too much data.  But being able to parse lazily
> would make it so incredibly easy to issue a command saying "download all
> new mail", and things get written to disk as they come in, with no
> buffer at all.

I'm not sure what that means, but to start at the beginning, ideally the
IMAP parser would be pure, right?

> 2) Avoiding Strings wherever possible.

It certainly makes sense to me that message data would be bytestring,
not only the "body" of the message but header fields as well.  Flags,
for me, would be string, unless you want to parse the standard flags
into a sum type.  No big deal, maybe bytestrings are more convenient
than I realize.

> 3) Avoiding complex buffering schemes where I have to manually buffer
> data packets.

This sounds to me like the application's problem, not the parser's?

I actually wrote the beginnings of an IMAP parser, for my own entertainment.
Substantially incomplete, in terms of support for various IMAP responses,
but it works against a couple of IMAP servers, and it supports GSSAPI
authentication and SSL.

Well, of course the IMAP parsing code itself has no idea about GSSAPI
or SSL, that being the application's job, but I think it's worth looking
at how for example GSSAPI authentication works with IMAP, while designing
the parser.

In the most general view, it may return either (response, remainder) or
(insufficient-data), and in the latter case the application gets more
data from the server and tries again.

-- 
Donn Cave <[EMAIL PROTECTED]>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] timing question

2008-08-03 Thread Arie Groeneveld

Suppose I've:

f = map g

I want to know how much time it takes (interpreted mode) to fully 
process list xs (at least 1e6 elements) with function g. Is it 
sufficient to execute:


*Main> last . f $ xs

(x.xx secs, yyy bytes)

Are there any hidden difficulties involved?

Reason is: comparing timings Haskell vs an interpreted language without 
laziness.



thanks

=@@i





___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] timing question

2008-08-03 Thread Arie Groeneveld

Sorry, should go the forum.

Ok, thanks. In this case the list consists of 6-digit alphanumeric
codes. So doing something like:

foldl1 (\x y -> g y) xs

will do the job?


=@@i


Bulat Ziganshin schreef:

Hello Arie,

Sunday, August 3, 2008, 1:56:43 PM, you wrote:

*Main>> last . f $ xs

this way you will get only "spin" of list computed, not elements
itself. something like sum should be used instead


  


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-03 Thread Tim Newsham

newsham:

Anyone interested in critiquing some code?  I'm looking for ideas
for making it faster and/or simpler:


What optimisation and runtime flags did you use (-threaded or not?)


currently "ghc -O --make $< -o $@".  For some measurements I tried
-threaded which seemed to have a slight slowdown and +RTS -N2 at
runtime which didnt seem to help.  I also ran some tests with
multiple clients running concurrently, and it seemed to handle them
at approximately the same rate with and without the threaded and
RTS flags (on an amd64x2).  Those flags should have allowed it to
handle two client connections (via forkIO) concurrently, right?

[ps: the same web directory has test clients and other versions of
the server.]

Tim Newsham
http://www.thenewsh.com/~newsham/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] timing question

2008-08-03 Thread Bulat Ziganshin
Hello Arie,

Sunday, August 3, 2008, 1:56:43 PM, you wrote:

*Main>> last . f $ xs

this way you will get only "spin" of list computed, not elements
itself. something like sum should be used instead


-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Derek Elkins
On Sun, 2008-08-03 at 00:52 -0700, Jason Dusek wrote:
> Derek Elkins <[EMAIL PROTECTED]> wrote:
> > Jason Dusek wrote:
> > > the unique arrow that goes from A+B to C+C is f+g -- but
> > > that would make C+C just the same as C.
> >
> > The unique arrow is f* : (A,B) -> (C,C), -not- an arrow A+B ->
> > C+C.  An arrow f : A+B -> C does -not- uniquely determine an
> > arrow A+B -> C+C such that the universal arrow diagram
> > commutes.
> 
>   Yes, I have confused my meaning a bit. +(f*) is also unique,
>   and that was the arrow I was thinking of.

Again, f* is what is being solved for and proved unique.

> 
>   So, we have f* : (A, B) -> (C, C), comprising h and k, so I
>   am not sure sure how + will act on it. As I've seen with + so
>   far, it works like this on arrows:
> 
> +((A -> C), (B -> C))  |->  A+B -> C
> 
>   So, for example, +(f, g) |-> [f,g] -- so what is f* made of?
>   This is what seems to be happening:
> 
> +((A, B) -> (C, C))  |->  A+B -> C+C
> 
>   So how are h and k paired? Their pairing puts them CxC but
>   seemingly in a different way from the way I've paired f and g.

The notation (A,B) is the notation for an object in a product category
in this case.  It is also the notation for a product in a category.
Usually context makes it clear which is which.  The notation f+g is the
notation for the functorial action of + : CxC -> C on arrows, that is,
if f : A -> B and g : C -> D then f+g : A+C -> B+D.

One issue you seem to have is with the notation which is admittedly
rather ambiguous.  Another is with the precise definition of universal
arrow.

e : FY -> B is a universal arrow (from F) iff
forall A and 
forall f : FA -> B
there exists a unique arrow g : A -> Y 
such that e . Fg = f

I prefer the representability perspective on universal arrows and that
can be arrived at by essentially Skolemizing the above definition.  If
we have a function f : X -> Y then forall x in X there exists a y in Y
namely f(x).  Adding that y must be unique adds the requirement that f
be injective.  Taking this we can rewrite the above as

e : FY -> B is a universal arrow (from F) iff
there exists an injective function t : Hom(FA,B) -> Hom(A,Y) forall A
such that forall f : FA -> B (that is forall f in Hom(FA,B))
e . F(t(f)) = f

Since for any arrow g : A -> Y
e . Fg = e . Fg and thus g = t(e . Fg) by uniqueness, we find that
t is actually surjective as well as injective, that is -every- function 
A -> Y is in the image of t.  A function is injective and surjective iff
it is a isomorphism.  So we can simplify the above.

e : FY -> B is a universal arrow (from F) iff
forall A
there is an isomorphism
Hom(FA,B) ~ Hom(A,Y)

This can be further simplified by the definition of a natural
isomorphism in Set.

e : FY -> B is a universal arrow (from F) iff
there is a natural isomorphism
Hom(F-,B) ~ Hom(-,Y)

The derivation of this definition captures the general pattern for all
proofs of the statements along the line of your original question.

There are three definitions of adjunction: one that uses
representability (i.e. an isomorphism of homsets like the last
definition of universal arrow above), one that uses universal arrows
(i.e. assume either the unit or the counit is component-wise a universal
arrow for all components), and one that uses the triangle identities.
It is a crucial skill to be able to switch between these definitions
seamlessly.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [darcs-users] [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ashley Moran
Sorry for the duplication, I'm now on the haskell-cafe list and wanted  
to track the other half of this thread.



On Aug 03, 2008, at 8:36 am, Don Stewart wrote:


And all this delay while the git juggernaut takes over the internet.



That's the biggest tragedy.  It's the same disappointment I have  
knowing Linux is more popular than FreeBSD!  Still, a project doesn't  
have to have a near-monopoly to be successful.  There are still far  
less people using Ruby than Java, but there's more than enough to  
provide a vibrant ecosystem.  (And it's one that churns out way more  
cool stuff than the Java world - there's no technical reason why  
Haskell couldn't do so too.)


GitHub is responsible for git's popularity.  Git is so popular not  
because it's the best, but because it has the best Web 2.0 site.  I  
work primarily in web development and it did occur to me to have a  
stab at darcshub, but I didn't know how much work would be involved in  
making something useful (I don't have much spare time right now), and  
if I'd be the only person that used it...


I think that would be a major boost for darcs though, if anyone wanted  
a go.  And it could be in any language, not just Haskell.


Ashley

--
http://www.patchspace.co.uk/
http://aviewfromafar.net/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-03 Thread Duncan Coutts
On Sat, 2008-08-02 at 19:13 -1000, Tim Newsham wrote:

> My measurements show that a simple dummy server (accept, forkio,
> recv byte) handles roughly 7500 requests/connects per second,
> the server/client that do real messages do about 4500 req and
> connections per second.  If all requests are on the same connection
> one after another it does about 13500 requests/second.  For
> comparisons, a C ping-pong server does about 3600/second if
> it has to fork for each new connection/request, and about 35000/sec
> if its all on the same connection.  So it seems at least competitive
> with a forking C server.  I havent tested threaded C servers.

What kind of performance do you actually need? Can your network
connection actually sustain the bandwidth of your synthetic benchmarks?

For reference, I've got a demo HAppS-based server which handles
reasonably high load pretty well I think:

(tested using apache-bench, loopback interface, amd64 @ 2.2GHz)

With cached content 450k:

with 1 concurrent client:
760 requests per second
~1ms latency
34Mb/s

with 100 concurrent clients:
1040 requests per second 
~90ms latency
46Mb/s

on a non-cached generated-on-demand 3k page:

with 1 concurrent client:
280 requests per second
~4ms latency
900Kb/s bandwidth

with 100 concurrent clients:
240 requests per second 
~400ms latency
750Kb/s bandwidth

Using http keep-alive boots requests per sec by ~20%


Obviously this is testing with a loopback network. My point is, it's
serving at a rather higher rate than most real network connections I
could buy (except local ethernet networks).

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [darcs-users] [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ashley Moran


On Aug 03, 2008, at 12:53 pm, Lele Gaifax wrote:


I fail to see what's so cool with GitHub: a quick overview didn't
reveal anything that couldn't be done with, say, Trac+Darcs. Can you
elaborate on that?


Hi Lele

It probably doesn't do anything you couldn't in Trac+darcs.  But  
that's not the point - it's easy to jump on there, and fork a repo,  
track the changes in both directions.  The barrier to working on a  
project on there is virtually nil (there is, of course, the issue of  
figuring out git when you've got the source on your machine, but  
that's a separate issue).


What GitHub does really well is build a community around the repos.   
They could have used Hg or bzr or pretty much and DVCS and been as  
successful, but they (unfortunately) chose git.




IMHO, the biggest problem with darcs is with its underdocumented (from
the technical point of view) code base, that only an handful of people
understand. As already stated, I doubt Haskell is the real culprit
here: the algorithms are effectively difficult to explain in any
language, English to starts with. I wish David used a less succint
coding style, and could spend some time to enlight and mentor new
developers, but that's the way it is.


My issue with the code base is the lack of unit tests.  Coming from a  
Ruby background, I'm used to very short methods with very specific  
tests, often for things that to new programmers look trivial.  To  
RSpec users, these unit tests *are* the documentation.  By comparison,  
darcs only has functional tests, and it's hard to see how you can tell  
what code is covered by them.  This would make me very wary about  
hacking at the code, not knowing if I could inadvertently break  
something.  It also means you have to understand much bigger chunks of  
code to know how to fix something.  I've very often fixed a bug in  
Ruby code because there's a one-line spec that describes exactly the  
behaviour that is at fault (or a missing one for the case I want).


I don't know what the standard for Haskell testing is, and how FP  
testing compares to OOP testing.


As a very trivial example the function  "showPatchInfo :: PatchInfo ->  
Doc" could do with a test to show it produces output of the format  
"Initial import Ashley Moran  
<[EMAIL PROTECTED]>**20080630153800]" (and if it  
*doesn't*, that is the point I'm making!)


I think having the patch algorithms broken down and tested in this way  
would be the best form of documentation, although a plain-English  
specification would probably also be necessary.  Simpler stuff (like  
showPatchInfo) just needs something to demonstrate what it does.


Just my (naive) opinion coming from a OOP, test-obsessed background.

Ashley


--
http://www.patchspace.co.uk/
http://aviewfromafar.net/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ketil Malde
"Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]> writes:

>> "Neil Mitchell" <[EMAIL PROTECTED]> writes:

>>> The darcs 2.0 announcement read like an obituary

>> I don't know why, but a lot of people I spoke to seemed to have that
>> impression, and I essentially had to wave changelogs under their
>> face to

  [...]

> didn't help.  All in all, it sounded an awful lot like "here's our
> final release, find new maintainers if you want it to continue" ---  
> followed by an ominous silence from the darcs camp.

Well, it seems to be up to 2.0.2 now, so it's clearly too early to
pass out the shovels.  On the other hand, I was trying to pull down
the repo, and got a 404 - that's not so good.  Is it down temporarily,
or is the front page incorrect?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [darcs-users] [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread David Bremner
At Sun, 3 Aug 2008 12:23:21 +0100,
Ashley Moran wrote:
> 
> GitHub is responsible for git's popularity.  Git is so popular not
> because it's the best, but because it has the best Web 2.0 site.  I
> work primarily in web development and it did occur to me to have a
> stab at darcshub, but I didn't know how much work would be involved in
> making something useful (I don't have much spare time right now), and
> if I'd be the only person that used it...

I think this view is probably coloured by your background in web
development. I have used git for about a year now, and never visited
GitHub.  I'm not saying you have to like git, but it does have other
features other than a snazzy web site.  

I do agree that adoption of development tools is driven by network
effects.  When I chose a DVCS to learn, I only wanted to learn one, so
I chose the one that seemed like it had the most momentum. The rich
get richer...

Maybe the answer is to work on Darcs-git :-)


David

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Kleisli composition operator

2008-08-03 Thread Roly Perera
Hi,

I'm obviously missing something basic here but I don't seem to be able to use
the >=> operator which is apparently defined in the Prelude and also in
Control.Monad.

My imports are:

import Prelude hiding (abs, lookup, init)

import Data.Maybe
import Data.List as List hiding (lookup, insert, delete, union, init)
import Data.Map as Map hiding (update, delete, union, null, findIndex)
import qualified Data.Tree as Tree
import Control.Monad
import Control.Monad.State

Any suggestions anyone?

thanks,
Roly Perera


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Kleisli composition operator

2008-08-03 Thread Roly Perera
> I'm obviously missing something basic here but I don't seem to be able to use
> the >=> operator which is apparently defined in the Prelude and also in
> Control.Monad.

Sorry, I wasn't very clear in my original posting.  What I meant to say is that
the compiler seems to be unable to find a definition of >=>.  I get the message:

Not in scope: `>=>'

My understanding is that I shouldn't need to import this at all by default, and
that importing Control.Monad should also pick it up.
 
> My imports are:
>
> import Prelude hiding (abs, lookup, init)
> 
> import Data.Maybe
> import Data.List as List hiding (lookup, insert, delete, union, init)
> import Data.Map as Map hiding (update, delete, union, null, findIndex)
> import qualified Data.Tree as Tree
> import Control.Monad
> import Control.Monad.State
> 
> Any suggestions anyone?
> 
> thanks,
> Roly Perera


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Gwern Branwen
On 2008.08.03 16:26:32 +0200, Ketil Malde <[EMAIL PROTECTED]> scribbled 0.7K 
characters:
> "Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]> writes:
>
> >> "Neil Mitchell" <[EMAIL PROTECTED]> writes:
>
> >>> The darcs 2.0 announcement read like an obituary
>
> >> I don't know why, but a lot of people I spoke to seemed to have that
> >> impression, and I essentially had to wave changelogs under their
> >> face to
>
>   [...]
>
> > didn't help.  All in all, it sounded an awful lot like "here's our
> > final release, find new maintainers if you want it to continue" ---
> > followed by an ominous silence from the darcs camp.
>
> Well, it seems to be up to 2.0.2 now, so it's clearly too early to
> pass out the shovels.  On the other hand, I was trying to pull down
> the repo, and got a 404 - that's not so good.  Is it down temporarily,
> or is the front page incorrect?
>
> -k
> --

I just darcs get http://darcs.net, so I would guess it was either temporary or 
a problem on your end.

--
gwern
JICS Golf package ETA QinetiQ AFSPC NSOF JCE DREO UXO


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Kleisli composition operator

2008-08-03 Thread Duncan Coutts
On Sun, 2008-08-03 at 14:52 +, Roly Perera wrote:
> > I'm obviously missing something basic here but I don't seem to be able to 
> > use
> > the >=> operator which is apparently defined in the Prelude and also in
> > Control.Monad.
> 
> Sorry, I wasn't very clear in my original posting.  What I meant to say is 
> that
> the compiler seems to be unable to find a definition of >=>.  I get the 
> message:
> 
> Not in scope: `>=>'
> 
> My understanding is that I shouldn't need to import this at all by default, 
> and
> that importing Control.Monad should also pick it up.

It's not in the Prelude but it is in Control.Monad in base version 3
and later. You're probably using an older GHC which has base version
2.x.

You can define it locally:

-- | Left-to-right Kleisli composition of monads.
(>=>)   :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c)
f >=> g = \x -> f x >>= g


Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Kleisli composition operator

2008-08-03 Thread Daniel Fischer
Am Sonntag, 3. August 2008 16:52 schrieb Roly Perera:
> > I'm obviously missing something basic here but I don't seem to be able to
> > use the >=> operator which is apparently defined in the Prelude and also
> > in Control.Monad.
>
> Sorry, I wasn't very clear in my original posting.  What I meant to say is
> that the compiler seems to be unable to find a definition of >=>.  I get
> the message:
>
> Not in scope: `>=>'
>
> My understanding is that I shouldn't need to import this at all by default,
> and that importing Control.Monad should also pick it up.
>
> > My imports are:
> >
> > import Prelude hiding (abs, lookup, init)
> >
> > import Data.Maybe
> > import Data.List as List hiding (lookup, insert, delete, union, init)
> > import Data.Map as Map hiding (update, delete, union, null, findIndex)
> > import qualified Data.Tree as Tree
> > import Control.Monad
> > import Control.Monad.State
> >
> > Any suggestions anyone?
> >
> > thanks,
> > Roly Perera
>

Which implementation are you using?
IIRC, GHC didn't have it in Control.Monad before the 6.8 branch.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Kleisli composition operator

2008-08-03 Thread Roly Perera
Daniel Fischer  web.de> writes:

> Which implementation are you using?
> IIRC, GHC didn't have it in Control.Monad before the 6.8 branch.

Duncan Coutts <[EMAIL PROTECTED]> writes:

> It's not in the Prelude but it is in Control.Monad in base version 3
> and later. You're probably using an older GHC which has base version
> 2.x.

Thanks for the quick responses.  Looks like I need to install a version later
than 6.8.

Roly


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [darcs-users] [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ashley Moran


On Aug 03, 2008, at 3:36 pm, David Bremner wrote:


I think this view is probably coloured by your background in web
development. I have used git for about a year now, and never visited
GitHub.  I'm not saying you have to like git, but it does have other
features other than a snazzy web site.


Hi David

I think I gave the wrong impression there.  After all, I use darcs  
despite it not having a snazzy website!  What I mean is that git usage  
has snowballed since GitHub was released, so people are clearly  
attracted to the website first, and the SCM second.  It's a bit like  
the way Rails created thousands of Ruby programmers by association,  
many of them with no idea what Ruby was all about, just a vague notion  
that Rails could solve their problem.


Ultimately my point is I think that MercurialHub or BazaarHub  
(BazaarBazaar?) would have been as successful.




I do agree that adoption of development tools is driven by network
effects.  When I chose a DVCS to learn, I only wanted to learn one, so
I chose the one that seemed like it had the most momentum. The rich
get richer...


I tend to very stubbornly work the other way... choose the tool I  
think works best with very little regard for its momentum, unless of  
course it clearly has none.  Hence my love of darcs and recent  
interest in Haskell.  (I'll figure it out, one day!)




Maybe the answer is to work on Darcs-git :-)


Well that's been looked at before... unfortunately it's been abandoned  
now.


There's also discussion on darcs-users that a Haskell implementation  
of Git would finally settle the "Haskell is too slow" debate.  Now I  
think if the world is going to use git, a better implementation would  
be a good thing (I know a developer who got VERY frustrated trying to  
program against it).  Personally I think the developer time would be  
better invested in fixing darcs bugs and improving its performance.



Ashley


--
http://www.patchspace.co.uk/
http://aviewfromafar.net/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ketil Malde
Gwern Branwen <[EMAIL PROTECTED]> writes:

> I just darcs get http://darcs.net, so I would guess it was either temporary 
> or a problem on your end.

Seems I needed a newer darcs - the one shipped with Ubuntu is 1.0.9,
which appears to be too old, and it works when I build a new 2.0.2
from the tarball.  (Anybody with write access to the front page who
can make a note of minimum version required to 'darcs get' the
repository?)

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] timing question

2008-08-03 Thread Brad Larsen
Arie,

foldl1 is not strict in its function argument.  Using it will cause stack 
overflows for large lists.

For example:

GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> foldl1 (+) [0..100]
*** Exception: stack overflow

foldl1' from Data.List is strict in its function argument, and is probably what 
you want.

See also .

Regards,
Brad Larsen


On Sun, 03 Aug 2008 07:06:40 -0400, Arie Groeneveld <[EMAIL PROTECTED]> wrote:

> Sorry, should go the forum.
>
> Ok, thanks. In this case the list consists of 6-digit alphanumeric
> codes. So doing something like:
>
> foldl1 (\x y -> g y) xs
>
> will do the job?
>
>
> =@@i
>
>
> Bulat Ziganshin schreef:
>> Hello Arie,
>>
>> Sunday, August 3, 2008, 1:56:43 PM, you wrote:
>>
>> *Main>> last . f $ xs
>>
>> this way you will get only "spin" of list computed, not elements
>> itself. something like sum should be used instead
>>
>>
>>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Jason Dusek
Derek Elkins <[EMAIL PROTECTED]> wrote:
> The notation f+g is the notation for the functorial action of
> + : CxC -> C on arrows, that is, if f : A -> B and g : C -> D
> then f+g : A+C -> B+D.

  So [f,g] and f+g different. I assumed that the functorial
  action of + on arrows was to take ((A -> C), (B -> C)) to
  A+B -> C, which goes a long way to explaining my confusion :)

-- 
_jsn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Jason Dusek
  So I guess the Wikipedia page has an error in it?

http://en.wikipedia.org/wiki/Coproduct#Definition

-- 
_jsn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ashley Moran


On Aug 03, 2008, at 5:36 pm, Ketil Malde wrote:


Seems I needed a newer darcs - the one shipped with Ubuntu is 1.0.9,
which appears to be too old, and it works when I build a new 2.0.2
from the tarball.  (Anybody with write access to the front page who
can make a note of minimum version required to 'darcs get' the
repository?)



Hi Ketil

Just FYI, Iain Lane made a darcs package for 2.0.2:

https://launchpad.net/~laney/+archive

Bit easier than compiling it from scratch.

Ashley

--
http://www.patchspace.co.uk/
http://aviewfromafar.net/

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] poll: how can we help you contribute to darcs?

2008-08-03 Thread Luke Palmer
On Fri, Aug 1, 2008 at 3:45 PM, Eric Kow <[EMAIL PROTECTED]> wrote:

> Dear Haskellers,
>
> I would like to take an informal poll for the purposes of darcs
> recruitment.  Could you please complete this sentence for me?
>
>   "I would contribute to darcs if only..."
>

I haven't used darcs much, so it's possible that I'll be forced to start
contributing by my own binding hypothetical.

I would contribute to darcs if only it had support / could have support for
splitting and merging repositories.  For example, I like to work in a big
repository of all my stuff ever, because most of the things I do rarely
exceed an experiment in one file.  But once something does get big enough to
be interesting, I want to split it off into its own repository.  But that's
just the use case: doing it the git way (go through all patches, discard
irrelevant ones, filter relevant ones, thus losing all correlation with the
original repository) is not going to inspire me; I'd like to see support for
it in the beautiful patch theory.

Luke


>
> The answers I am most interested in hearing go beyond "... I had more
> time".  For instance, if you are contributing to other Haskell/volunteer
> projects, why are you contributing more to them, rather than darcs?
>
>
>
>
>
>
>
> The context:
>
> Lately, darcs has suffered a setback: the GHC team has decided that it
> is now time to switch to a different system, like git or Mercurial.
> This is probably a good thing for GHC and for us.  By the way, good
> luck to them, and thanks for everything! (better GHC == better darcs)
>
> But where is darcs going?  For now, we are going to have to focus on
> what we do best, providing precision merging and a consistent user
> interface for small-to-medium sized projects.  I want more, though!  I
> want to see darcs 2.1 come out next year, performance enhanced out the
> wazoo, and running great on Windows.  And I want to see Future Darcs,
> the universal revision control system, seamlessly integrating with
> everybody else.
>
> We need to learn to do better so that darcs can achieve this kind of
> wild success.  For example, whereas darcs suffers from the "day job"
> problem, xmonad has had to turn developers away!
>
> As Don mentions, this is partly thanks to their extreme accessibility
> (better self-documentation).  But does anyone have more specific ideas
> about things we need to change so that you can contribute to darcs?
> How do we hit critical hacker mass?
>
> I have jotted down some other thoughts here regarding recruitment here:
>  http://wiki.darcs.net/index.html/Recruitment
>
> In the meantime, if you have been discouraged from hacking on darcs,
> we want to know why, and how we can change things!
>
> Thanks,
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Daniel Fischer
Am Sonntag, 3. August 2008 19:03 schrieb Jason Dusek:
>   So I guess the Wikipedia page has an error in it?
>
> http://en.wikipedia.org/wiki/Coproduct#Definition
One typo, it must be f_j = f o i_j instead of f_j = i_j o f, apart from that 
it looks correct.
Didn't go through the examples, though, there may be further mistakes.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] timing question

2008-08-03 Thread Luke Palmer
On Sun, Aug 3, 2008 at 11:06 AM, Arie Groeneveld <[EMAIL PROTECTED]> wrote:

> Sorry, should go the forum.
>
> Ok, thanks. In this case the list consists of 6-digit alphanumeric
> codes. So doing something like:
>
> foldl1 (\x y -> g y) xs


No, that still doesn't force elements.  Let's say g is (+1):

f = \x y -> (+1) y
foldl1 f [1,2,3]

(1 `f` 2) `f` 3
(+1) 3
4

So we don't need to compute (+1) on any numbers but 3.

The most direct way is to force the elements of the list:

import Control.Parallel.Strategies
seqList rwhnf (map g xs)

Note that the notion of "compute" in this example is to WHNF, so for example
if g produces lists, it will only evaluate far enough to determine whether
the list is a nil or a cons, not the whole thing.


> will do the job?
>
>
> =@@i
>
>
> Bulat Ziganshin schreef:
>
>> Hello Arie,
>>
>> Sunday, August 3, 2008, 1:56:43 PM, you wrote:
>>
>> *Main>> last . f $ xs
>>
>> this way you will get only "spin" of list computed, not elements
>> itself. something like sum should be used instead
>>
>>
>>
>>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] timing question

2008-08-03 Thread Don Stewart
bradypus:
> Suppose I've:
> 
> f = map g
> 
> I want to know how much time it takes (interpreted mode) to fully 
> process list xs (at least 1e6 elements) with function g. Is it 
> sufficient to execute:
> 
> *Main> last . f $ xs
> 
> (x.xx secs, yyy bytes)
> 
> Are there any hidden difficulties involved?
> 
> Reason is: comparing timings Haskell vs an interpreted language without 
> laziness.
> 

If you care about timings, it's probably a better idea to compile the
code (with optimisations on), to get a better idea of what the code
would do in a production environment.

You could then just time the binary,

main = print . sum $ 

ghc -O2 A.hs --make
time ./A

-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Andrew Coppin

Trent W. Buck wrote:

I don't know why, but a lot of people I spoke to seemed to have that
impression, and I essentially had to wave changelogs under their face to
convince them that darcs was still being worked on *at all*.  I had to
point out that it was a *release* announcement -- how could a dead
project have a new major version?

Perhaps a chirpy journalism major should be writing vapidly up-beat
announcement posts, denying even the possibility of problems :-P
  


Correct me if I'm wrong, but... I was under the impression that Darcs is 
a revision control system. It controls revisions.


Well Darcs already does that. So... what's to develop? It's not like 
it's slow or buggy. I can't actually think of any features it doesn't 
have that I want. So... what now?


In case that sounds really negative and critical, let me phrase it 
another way: Given that Darcs is more or less perfect now, what's to add?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Jason Dusek
  What about the part that reads:

The unique arrow f making this diagram commute is then
correspondingly denoted f1 ∐ f2 or f1 ⊕ f2 or f1 + f2 or
[f1, f2]

  This would seem to say that [f,g] and f+g are the same thing
  -- but if I've understood Derek Elkins' remarks, the latter is
  the functorial action on arrows while the former is just the
  mediating arrow.

-- 
_jsn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] website update how-to

2008-08-03 Thread Simon Michael

Ketil Malde wrote:

(Anybody with write access to the front page who
can make a note of minimum version required to 'darcs get' the
repository?)


I've submitted a patch. For reference, here's how to change the website:

0. get yourself a working darcs 2 by installing a binary or building the 
source tarball


1. darcs get or pull the latest darcs code

2. edit and record doc/index.html.in

3. darcs send and wait for David's review

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Kleisli composition operator

2008-08-03 Thread Duncan Coutts
On Sun, 2008-08-03 at 15:31 +, Roly Perera wrote:
> Daniel Fischer  web.de> writes:
> 
> > Which implementation are you using?
> > IIRC, GHC didn't have it in Control.Monad before the 6.8 branch.
> 
> Duncan Coutts <[EMAIL PROTECTED]> writes:
> 
> > It's not in the Prelude but it is in Control.Monad in base version 3
> > and later. You're probably using an older GHC which has base version
> > 2.x.
> 
> Thanks for the quick responses.  Looks like I need to install a version later
> than 6.8.

GHC 6.8 comes with base-3 so has (>=>) in Control.Monad.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Austin Seipp
Excerpts from Andrew Coppin's message of Sun Aug 03 04:35:32 -0500 2008:
> Correct me if I'm wrong, but... I was under the impression that Darcs is 
> a revision control system. It controls revisions.
> 
> Well Darcs already does that. So... what's to develop? It's not like 
> it's slow or buggy. I can't actually think of any features it doesn't 
> have that I want. So... what now?
> 
> In case that sounds really negative and critical, let me phrase it 
> another way: Given that Darcs is more or less perfect now, what's to add?

At this point I feel it is an issue of what can be fixed rather than
what can be added.

The current issues with darcs right now I feel are:

 * Predictability. There is no such thing with darcs. If I try to get
 copies of the base libraries up to date in the latest GHC-head
 (via a ./darcs-all pull -a,) it might pull all the libraries. It
 might not. It might randomly stop at identifying the repository
 format of 'base/array.' It might get all the way to 'base/unix' and
 begin pulling patches before it stops. In either case, darcs never
 quits, I'm never sure of what state it is in during the pull and
 frankly I just don't know what's going on sometimes.

 * Usability is dodgy under high load. To date, I think GHC is the
 best candidate for qualifying as 'high load,' but even then I'm not
 sure if the comparison is quite as fair if GHC is still using an
 old-fashioned darcs format (i.e. darcs1-style repo.) Regardless I am
 still skeptical at this point of darcs ability to handle high load.

 * Random quirks, e.g. some file edits may unknowingly introduce an
 explicit dependency on patches, meanining while two patches A and B
 are unrelated in all forms of the word, it will still mark 'A' as
 dependent on 'B'. So you've basically lost the ability to unrecord
 flexibly, since unrecord is going to skip the patches that are marked
 as dependent on something else, when they really are not.

Quite honestly I think darcs 2 is a fine release and a very good
improvement; it fixed a lot of the older nasty quirks
(exponential-time merge bug in particular) and any project considering
darcs should use the new format immediately. I think for medium to
small sized projects it is great. It will continue to fit those
projects very well, but when push comes to shove, darcs won't cut it,
I feel.

To answer the question and be honest about it: I would work on darcs
if I was getting paid.

Darcs lost I think because of its internals, because it simply was not
feasible for people to get involved and make core improvements. You
basically were either David or you weren't. Other VCS's generally
speaking have a lot more simple foundation: git only has only 4 base
objects that you encounter every day in your workflow. These are the
primitives of all operations in git, and everything else is built on
top of them. Because of it, anybody with some experience in using git
can probably get reasonably comfortable with the source code in a
non-crazy amount of time. There is a lower barrier of entry to the
source code, ideas and development process. The simpler design simply
facilitates contributions where it matters, IMO.

While I don't want to sound so unsupportive of the excellent work
everybody involved in darcs has contributed, that is currently the way
I see darcs and unless I was getting paid I would not be compelled to
work on the source code as I have already moved to another system
(git.)

I think darcs made a landmark is usability for a DVCS, and I also
think the way in which patches are managed with darcs is very
nice. However, I've found git's approach sufficiently simple (to the
point where my limited brain can comprehend it) and cherry-picking is
a common point among version control systems these days (git add -i.)
So I've found home elsewhere.

Austin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] poll: how can we help you contribute to darcs?

2008-08-03 Thread Brandon S. Allbery KF8NH


On 2008 Aug 3, at 13:15, Luke Palmer wrote:


On Fri, Aug 1, 2008 at 3:45 PM, Eric Kow <[EMAIL PROTECTED]> wrote:
  "I would contribute to darcs if only..."

I haven't used darcs much, so it's possible that I'll be forced to  
start contributing by my own binding hypothetical.


I would contribute to darcs if only it had support / could have  
support for splitting and merging repositories.  For example, I


Maybe that's what you should contribute.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Brandon S. Allbery KF8NH


On 2008 Aug 3, at 5:35, Andrew Coppin wrote:

Well Darcs already does that. So... what's to develop? It's not like  
it's slow or buggy. I


slow:  see ghc moving away from darcs.  once you reach a certain  
number of patches, it becomes *very* slow --- even with darcs 2's  
speedups.


buggy:  there are known screw cases where darcs cannot solve the  
constraint problem set by certain combinations of patches.


(I admit to being uncertain about the latter; it sounds to me a lot  
like the room scheduling problem, which is NP-complete.  But I didn't  
get most of the fancy maths so I could well be wrong.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Brandon S. Allbery KF8NH


On 2008 Aug 3, at 5:35, Andrew Coppin wrote:

Well Darcs already does that. So... what's to develop? It's not like  
it's slow or buggy. I


Oh, two more under "buggy":

(a) as mentioned by others, the ghc repos often cause darcs2 to spin  
without doing anything.  (This may secretly be the network library;  
strace looks an awful lot like my lambdabot when it gets stuck, but  
it's hard to tell because that may just be the thread scheduler.)


(b) it doesn't handle the case where a file is renamed to avoid upper/ 
lowercase issues, on filesystems which treat them the same (Windows,  
OSX).  It should be possible to arrange to not have both on disk at  
the same time.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-03 Thread Tim Newsham

What kind of performance do you actually need? Can your network
connection actually sustain the bandwidth of your synthetic benchmarks?


This is just an exercise at the moment, so no particular performance
goal beyond "how fast can it go".


(tested using apache-bench, loopback interface, amd64 @ 2.2GHz)
With cached content 450k:
with 1 concurrent client:
   760 requests per second
   ~1ms latency
   34Mb/s

[...]

Obviously this is testing with a loopback network. My point is, it's
serving at a rather higher rate than most real network connections I
could buy (except local ethernet networks).


My requests and responses are fairly small, a typical request is 29bytes
and a typical response is 58bytes.  If you just count these payloads
its about 390kB/sec for 4.5kreq/sec and 1.2MB/sec for 13.5kreq/sec
(of course its more like double these as the TCP overhead will be
about the same size).  Anyway, with such small sizes, the performance
shouldn't be limited by the bandwidth (I dont think).  If this was
a back-end storage server, the network probably wouldn't be the
limiting factor.


Duncan


Tim Newsham
http://www.thenewsh.com/~newsham/___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Jason Dagit
I've been lurking on this thread, collecting the valuable feedback.  Thanks
all.

On Sun, Aug 3, 2008 at 12:06 PM, Brandon S. Allbery KF8NH <
[EMAIL PROTECTED]> wrote:

>
> On 2008 Aug 3, at 5:35, Andrew Coppin wrote:
>
>  Well Darcs already does that. So... what's to develop? It's not like it's
>> slow or buggy. I
>>
>
> Oh, two more under "buggy":
>
> (a) as mentioned by others, the ghc repos often cause darcs2 to spin
> without doing anything.  (This may secretly be the network library; strace
> looks an awful lot like my lambdabot when it gets stuck, but it's hard to
> tell because that may just be the thread scheduler.)


I just want to clarify one point about darcs1 vs. darcs2.  The darcs2
program works on both darcs1 and darcs2 format repositories.  When it works
with darcs1 format repositories it works the way darcs has always worked on
darcs1 repositiories.  Thus, it's not fair to say that the above problem
exists in darcs2 format repositories since the GHC repository was never
publicly converted to darcs2 format.  So, the spinning of the darcs2 program
on the GHC repository is due to flaws in darcs1 format that have hopefully
all been corrected in darcs2 format.

Yes, this is a known bug, but also one that has received considerable
effort, and is currently presumed to be fixed for darcs2 format
repositories.  Bug reports and test cases to the contrary are welcome.

Jason
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Derek Elkins
On Sun, 2008-08-03 at 11:03 -0700, Jason Dusek wrote:
> What about the part that reads:
> 
> The unique arrow f making this diagram commute is then
> correspondingly denoted f1 ∐ f2 or f1 ⊕ f2 or f1 + f2 or
> [f1, f2]
> 
>   This would seem to say that [f,g] and f+g are the same thing
>   -- but if I've understood Derek Elkins' remarks, the latter is
>   the functorial action on arrows while the former is just the
>   mediating arrow.

In my experience the functorial action of a functor on arrows almost
always has the same symbol as the action on objects.  Furthermore, I
don't think I've ever seen an example where the symbol used for the
action on objects was used for something other than the action on
arrows.  I do think I have seen examples when a different symbol was
used.  If A+B is used then f+g should be the action on arrows.

Admittedly wikipedia does violate this.  Perhaps it's using conventions
from some branch that I'm not familiar with.  Maybe it is just silly.
"Categories for the Working Mathematician" uses the convention I
describe here.  Although it doesn't seem to have a notation for the
mediating arrow (what I usually write as [f,g]).

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] poll: how can we help you contribute to darcs?

2008-08-03 Thread Duncan Coutts
On Fri, 2008-08-01 at 16:45 +0100, Eric Kow wrote:
> Dear Haskellers,
> 
> I would like to take an informal poll for the purposes of darcs
> recruitment.  Could you please complete this sentence for me?
> 
>"I would contribute to darcs if only..."
> 
> The answers I am most interested in hearing go beyond "... I had more
> time".  For instance, if you are contributing to other Haskell/volunteer
> projects, why are you contributing more to them, rather than darcs?

It would be useful if some darcs 2 hackers, contributors could help the
ghc people evaluate if darcs 2 is still in the running. That would mean
identifying the key bugs (eg windows case-insensitive file bugs, slow
pulls) and seeing how hard they are to fix. Also doing a test conversion
to darcs 2 format and benchmarking some of the key operations described
on the ghc evaluation page.

http://hackage.haskell.org/trac/ghc/wiki/DarcsEvaluation


Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Memory problems reading a IntMap from a binary file

2008-08-03 Thread Ludger Steens

Hi,

I have IntMap String with about 40,000 entries. After saving it to disk 
(via Data.Binary) the file is 3.5 Mb small. However if I load it and 
save it back again my program needs 180 MB memory. Is there anything I 
do wrong or does the map really need that much memory?


The (simple) program I wrote:

main =
   do
   mp <- decodeFile "i.bin" :: IO ( IntMap String )
   encodeFile "i2.bin" mp
   exitWith ExitSuccess

Thanks,
Ludger
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] adjoint of coproduct & diagonal

2008-08-03 Thread Jason Dusek
Derek Elkins <[EMAIL PROTECTED]> wrote:
> Jason Dusek wrote:
>> What about the part that reads:
>>
>> The unique arrow f making this diagram commute is then
>> correspondingly denoted f1 ∐ f2 or f1 ⊕ f2 or f1 + f2 or
>> [f1, f2]
>>
>>   This would seem to say that [f,g] and f+g are the same thing
>>   -- but if I've understood Derek Elkins' remarks, the latter is
>>   the functorial action on arrows while the former is just the
>>   mediating arrow.
>
> In my experience the functorial action of a functor on arrows almost
> always has the same symbol as the action on objects.  Furthermore, I
> don't think I've ever seen an example where the symbol used for the
> action on objects was used for something other than the action on
> arrows.  I do think I have seen examples when a different symbol was
> used.  If A+B is used then f+g should be the action on arrows.
>
> Admittedly wikipedia does violate this. Perhaps it's using conventions
> from some branch that I'm not familiar with. Maybe it is just silly.

  Indeed. Using f1 ∐ f2 or f1 + f2 for the mediating arrow is
  confusing, to say the least.

-- 
_jsn
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Memory problems reading a IntMap from a binary file

2008-08-03 Thread Don Stewart
lutzsteens:
> Hi,
> 
> I have IntMap String with about 40,000 entries. After saving it to disk 
> (via Data.Binary) the file is 3.5 Mb small. However if I load it and 
> save it back again my program needs 180 MB memory. Is there anything I 
> do wrong or does the map really need that much memory?


String can be really expensive. Try an IntMap ByteString

> 
> The (simple) program I wrote:
> 
> main =
>do
>mp <- decodeFile "i.bin" :: IO ( IntMap String )
>encodeFile "i2.bin" mp
>exitWith ExitSuccess
> 
> Thanks,
> Ludger
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ben Franksen
Luke Palmer wrote:
> On Fri, Aug 1, 2008 at 3:45 PM, Eric Kow <[EMAIL PROTECTED]> wrote:
>>
>>   "I would contribute to darcs if only..."
>>
> 
> I haven't used darcs much, so it's possible that I'll be forced to start
> contributing by my own binding hypothetical.
> 
> I would contribute to darcs if only it had support / could have support
> for
> splitting and merging repositories.  For example, I like to work in a big
> repository of all my stuff ever, because most of the things I do rarely
> exceed an experiment in one file.  But once something does get big enough
> to
> be interesting, I want to split it off into its own repository.  But
> that's just the use case: doing it the git way (go through all patches,
> discard irrelevant ones, filter relevant ones, thus losing all correlation
> with the original repository) is not going to inspire me; I'd like to see
> support for it in the beautiful patch theory.

I have once proposed a scheme that would nicely solve this.

The naive way to emulate your split feature would be to create a branch
where you delete all the stuff you don't want and then maybe move the
subproject to a new directory (nearer the top-level). This doesn't work,
however, at least not in practice. This is because deletion of a file
conflicts with a change to the same file which leads to a huge amount of
conflicts each time you pull from the old combined repo. And the reason you
get these conflicts is that in darcs a file always gets emptied before
deletion, and this is because changing a file depends on its existence in
the first place. I proposed to change this and allow changes to
non-existing files, so called 'ghosts'. This has a number of interesting
consequences, among them that you could delete as many files as you want
and will never again get a conflict with changes to those files (that is,
unless you explicitly 'resurrect' the ghost).

Unfortunately few people (and none of the core-developers) seemed to be
interested :( The small thread that developed on the darcs-users list
should still be available in the archives if you are interested in the
details.

Cheers
Ben

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: question about "faulting in" Haskell packages ...

2008-08-03 Thread Ben Franksen
david48 wrote:
> for each package you have to type (*) :
> 
> runhaskell Setup.hs configure
> runhaskell Setup.hs build
> sudo runhaskell Setup.hs install
> 
> (*) sometimes it'll be Setup.lhs, I'm annoyed that it's not always the
> same name, can't rely on shell history :(

Same here; my solution is to always compile it using 'ghc --make Setup'
(note the missing extension) and then ./Setup afterwards.

Cheers
Ben

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Brandon S. Allbery KF8NH


On 2008 Aug 3, at 19:16, Ben Franksen wrote:

The naive way to emulate your split feature would be to create a  
branch

where you delete all the stuff you don't want and then maybe move the
subproject to a new directory (nearer the top-level). This doesn't  
work,

however, at least not in practice. This is because deletion of a file
conflicts with a change to the same file which leads to a huge  
amount of
conflicts each time you pull from the old combined repo. And the  
reason you

get these conflicts is that in darcs a file always gets emptied before
deletion, and this is because changing a file depends on its  
existence in

the first place. I proposed to change this and allow changes to
non-existing files, so called 'ghosts'. This has a number of  
interesting
consequences, among them that you could delete as many files as you  
want
and will never again get a conflict with changes to those files  
(that is,

unless you explicitly 'resurrect' the ghost).

Unfortunately few people (and none of the core-developers) seemed to  
be

interested :( The small thread that developed on the darcs-users list
should still be available in the archives if you are interested in the
details.



I would suggest that they'd be more interested if you provided code;  
if they have no need for your proposal they're unlikely to devote time  
to coding it.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Brainstorming on how to parse IMAP

2008-08-03 Thread Ben Franksen
John Goerzen wrote:
> I'm interested in writing a library to work with IMAP servers.
> 
> I'm interested in thoughts people have on parsing libraries and methods.
>  I'm a huge fan of Parsec overall -- it lets me have a single-stage
> parser, for instance.  But it isn't sufficiently lazy for this task, and
> I probably will need to deal with ByteStrings instead of Strings, since
> some IMAP messages may be 30MB or more.

You might be interested in Frisby: http://repetae.net/computer/frisby/

Cheers
Ben

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] HDBC-ODBC linking problems in windows.

2008-08-03 Thread Andrew Appleyard

Hi PJ,

On 2/08/2008 4:09 AM, you wrote:

I am having issues getting hdbc/odbc working on windows.

When using GHC, I am not able to compile a simple program. It ends up
with linker errors like
[...]
Is there an easy workaround for this? Or am I doing something wrong?

MySetup
===
Windows XP SP2
ghc 6.8.3
hdbc  1.1.5.0
hdbc-odbc 1.1.4.3.0


hdbc-odbc 1.1.4.4 contains a patch to the calling convention of the ODBC 
functions (from ccall to stdcall).


Grab version 1.1.4.4 from Hackage [1] and hopefully that'll fix your 
problem.


[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HDBC-odbc

Regards,
Andrew
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Ben Franksen
Brandon S. Allbery KF8NH wrote:
> On 2008 Aug 3, at 19:16, Ben Franksen wrote:
>> The naive way to emulate your split feature would be to create a
>> branch
>> where you delete all the stuff you don't want and then maybe move the
>> subproject to a new directory (nearer the top-level). This doesn't
>> work,
>> however, at least not in practice. This is because deletion of a file
>> conflicts with a change to the same file which leads to a huge
>> amount of
>> conflicts each time you pull from the old combined repo. And the
>> reason you
>> get these conflicts is that in darcs a file always gets emptied before
>> deletion, and this is because changing a file depends on its
>> existence in
>> the first place. I proposed to change this and allow changes to
>> non-existing files, so called 'ghosts'. This has a number of
>> interesting
>> consequences, among them that you could delete as many files as you
>> want
>> and will never again get a conflict with changes to those files
>> (that is,
>> unless you explicitly 'resurrect' the ghost).
>>
>> Unfortunately few people (and none of the core-developers) seemed to
>> be
>> interested :( The small thread that developed on the darcs-users list
>> should still be available in the archives if you are interested in the
>> details.
> 
> I would suggest that they'd be more interested if you provided code;
> if they have no need for your proposal they're unlikely to devote time
> to coding it.

You are suggesting that I am expecting others to devote time to code
proposals of mine. I don't know where you get this idea. I am used to
discuss the merits of a new feature, especially one so far-reaching, before
starting to unilaterally throw code at a project. Your own style of
collaboration might be different, though.

Anyway, I would suggest that you add something of interest rather than
patronizing people with dubious 'suggestions'.

Cheers
Ben

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread Trent W. Buck
Ashley Moran <[EMAIL PROTECTED]> writes:
> On Aug 03, 2008, at 5:36 pm, Ketil Malde wrote:
>> Seems I needed a newer darcs - the one shipped with Ubuntu is 1.0.9,
>> which appears to be too old, and it works when I build a new 2.0.2
>> from the tarball.  (Anybody with write access to the front page who
>> can make a note of minimum version required to 'darcs get' the
>> repository?)

AFAIK, the current darcs darcs repo should be gettable with any 2.x
version of darcs.

Since darcs is self-hosting, you gotta expect bootstrapping issues when
using older-than-the-current-release versions to checkout the repo.
(Hence grabbing the source tarball.)

> FYI, Iain Lane made a darcs package for 2.0.2:
> https://launchpad.net/~laney/+archive

You should also be able to backport it from Intrepid (Hardy+1).  There
may be a hardy-backports version, too, but packages.ubuntu.com won't
talk to me just now.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [darcs-users] [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread John Goerzen
Ashley Moran wrote:
> On Aug 03, 2008, at 3:36 pm, David Bremner wrote:
> 
>> I think this view is probably coloured by your background in web
>> development. I have used git for about a year now, and never visited
>> GitHub.  I'm not saying you have to like git, but it does have other
>> features other than a snazzy web site.
> 
> Hi David
> 
> I think I gave the wrong impression there.  After all, I use darcs  
> despite it not having a snazzy website!  What I mean is that git usage  
> has snowballed since GitHub was released, so people are clearly  
> attracted to the website first, and the SCM second.  It's a bit like  
> the way Rails created thousands of Ruby programmers by association,  
> many of them with no idea what Ruby was all about, just a vague notion  
> that Rails could solve their problem.

I know of exactly 0 programmers that use Git because of GitHub.

I have interacted with exactly 1 project that used GitHub.

I know of many, many programmers that use Git.

Git people are choosing Git for other reasons.  I've spelled out some of
the reasons I chose it before; I could bore you with URLs if you like ;-)

Git is a really nice DVCS.  That has nothing to do with the presence of
one particular website.

> I tend to very stubbornly work the other way... choose the tool I  
> think works best with very little regard for its momentum, unless of  
> course it clearly has none.  Hence my love of darcs and recent  
> interest in Haskell.  (I'll figure it out, one day!)

Haskell has momentum, I swear!

> There's also discussion on darcs-users that a Haskell implementation  
> of Git would finally settle the "Haskell is too slow" debate.  Now I  
> think if the world is going to use git, a better implementation would  
> be a good thing (I know a developer who got VERY frustrated trying to  
> program against it).  Personally I think the developer time would be  
> better invested in fixing darcs bugs and improving its performance.

Yes, I am not sure the world needs a reimplemented Git.  As a user, I
would say, "what's the benefit?"  I don't see one.  That's an awful lot
of work.

As a developer, yes Git's internals are, shall we say, inconsistent.
But what do I care?  Git's interface is a shell tool, and I can use any
programming language I want to work with it.  I've already done so with
sh, Haskell, and (ugh) Ruby.

-- John
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: poll: how can we help you contribute to darcs?

2008-08-03 Thread John Goerzen
Andrew Coppin wrote:
> Trent W. Buck wrote:
>> I don't know why, but a lot of people I spoke to seemed to have that
>> impression, and I essentially had to wave changelogs under their face to
>> convince them that darcs was still being worked on *at all*.  I had to
>> point out that it was a *release* announcement -- how could a dead
>> project have a new major version?
>>
>> Perhaps a chirpy journalism major should be writing vapidly up-beat
>> announcement posts, denying even the possibility of problems :-P
>>   
> 
> Correct me if I'm wrong, but... I was under the impression that Darcs is 
> a revision control system. It controls revisions.
> 
> Well Darcs already does that. So... what's to develop? It's not like 
> it's slow or buggy. I can't actually think of any features it doesn't 
> have that I want. So... what now?

Erm, actually it is.  Both.  Well, at least the slow bit is still quite
there in 2.0, though better.  The IndempotentMerge problem?  I guess it
sounds like this is better in 2.0, though not completely fixed.

I still laugh when I remember droundy telling me something along the
lines of, "No, that is NOT an infinite loop.  It will finish in a couple
of weeks." 

-- John
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] your RSA code

2008-08-03 Thread Galchin, Vasili
Hi John,

I am reading your RSA code as suggested.

1) Do you have an example code that uses your RSA API?

2) a ForeignPtr is created in function createPkey and "returned" to the
caller. I am trying to follow which function(s) GC the associated heap. ??

3) My assertion: It seems in my Posix asynch IO case ... that functions like
aioRead, aioWrite, lioListIO would create ForeignPtrs that would "carried
around in the AIO application and the associated heap would only be GC'd
(garbage collected) when  aioReturn or aio_Cancel get called. True?

Kind regards, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe