[Haskell-cafe] Re: [darcs-users] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-31 Thread David Roundy
On Thu, Oct 30, 2008 at 01:30:51PM -0700, Jason Dagit wrote:
 On Thu, Oct 30, 2008 at 1:22 PM, Juliusz Chroboczek
 [EMAIL PROTECTED] wrote:
  Also, note that Lenny has 6.8, and it is scheduled to become stable Real
  Soon Now.
 
  That's irrelevant.  Lenny going stable will not cause my servers to
  automatically get upgraded.
 
  FWIW, the experimental server is scheduled to switch to lenny in the summer
  of 2009.  There is no ETA for the production servers, which tend to be
  managed more conservatively still.
 
 But surely if you have such conservative upgrade practices you also
 only run stable releases of darcs right?  All the existing stable
 releases build on ghc6.6.
 
 I was not sufficiently clear in my original question.  My question
 really only applies to people who build from the darcs.net
 respository.  HEAD as some people might call it.

No, darcs is buggier than the average code, and it's reasonable to
want those bugs fixed, even on stable servers.

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


Re: [Haskell-cafe] Re: [darcs-users] Poll: Do you need to be able to build darcs from source on GHC 6.6?

2008-10-31 Thread David Roundy
On Thu, Oct 30, 2008 at 03:08:29PM -0700, Don Stewart wrote:
 dagit:
  On Thu, Oct 30, 2008 at 1:20 PM, Juliusz Chroboczek
  [EMAIL PROTECTED] wrote:
   I wanted to know if anyone who is using distros with 6.6 need to be
   able to build current releases of darcs from source.
  
   If there turns out to be a significant issue with Darcs 1, I need to be
   able to build a recent version of Darcs in my Debian stable chroot.
  
  I see.  If you're using the darcs 1 binary I would encourage you to
  upgrade.  If  you meant darcs 1 repository format then I would
  encourage you to consider darcs 1 hashed repository format.  You don't
  even have to upgrade the public facing repo.  Just 'darcs get --hashed
  ...'.
  
   The alternative is to build a static version of Darcs that I can install 
   on
   my stable (soon to be oldstable) servers.  Last time I checked, building
   static Darcs didn't work.
  
  Interesting.  Yes, building darcs statically is something we should
  probably do on the build bots.
 
 Statically linked darcs should be trivial with the cabal version.

The bug is in debian's libcurl.

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


[Haskell-cafe] Cairo build fail on OS X Leapord

2008-10-31 Thread Jefferson Heard
Installing gtk2hs from MacPorts on a clean mac:

2 -I/usr/X11R6/include

svgcairo/Graphics/Rendering/Cairo/SVG.chs:201:2:
Couldn't match expected type `()' against inferred type `CInt'
  Expected type: Render ()
  Inferred type: Render CInt
In the expression:
  liftIO
$ (\ (SVG arg1) (Cairo arg2)
   - withForeignPtr arg1
$ \ argPtr1 - rsvg_handle_render_cairo argPtr1 arg2)
svg cr
In the expression:
do cr - ask
 liftIO
   $ (\ (SVG arg1) (Cairo arg2)
  - withForeignPtr arg1
   $ \ argPtr1 - rsvg_handle_render_cairo argPtr1 arg2)
   svg cr
make[1]: *** [svgcairo/Graphics/Rendering/Cairo/SVG.o] Error 1
rm svgcairo/Graphics/Rendering/Cairo/SVG.hs
make: *** [all] Error 2

Error: Status 1 encountered during processing.


-- 
I try to take things like a crow; war and chaos don't always ruin a
picnic, they just mean you have to be careful what you swallow.

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


[Haskell-cafe] Newbie on instance of Monad

2008-10-31 Thread Mauricio

Hi,

After a lot of thinking, I can't get what I
am doing wrong in this code:

--
data ( RandomGen g ) = RandomMonad g a = RandomMonad (g - a)

instance Monad (RandomMonad g) where
  return = RandomMonad . const
  RandomMonad f1 = f2 = RandomMonad f3 where
f3 a = f2f1 a (next a)
RandomMonad f2f1 = f2 . f1
--

I get this error message:

Could not deduce (RandomGen g)
 from the context (Monad (RandomMonad g))
 arising from a use of `RandomMonad' at src/encherDB.hs:10:11-21
  Possible fix:
   add (RandomGen g) to the context of the type signature for `return'
In the first argument of `(.)', namely `RandomMonad'
In the expression: RandomMonad . const
In the definition of `return': return = RandomMonad . const

but I'm not smart enough to understand what
it means.

Thanks a lot,
Maurício

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


Re: [Haskell-cafe] Newbie on instance of Monad

2008-10-31 Thread Henning Thielemann


On Fri, 31 Oct 2008, Mauricio wrote:


Hi,

After a lot of thinking, I can't get what I
am doing wrong in this code:

--
data ( RandomGen g ) = RandomMonad g a = RandomMonad (g - a)


RandomGen g is considered the constraint for the application of 
RandomMonad constructor, but GHC does not conclude that every value of 
(RandomMonad g a) fulfills this constraint. Actually, 'undefined' is 
available for any 'g'.



instance Monad (RandomMonad g) where
 return = RandomMonad . const
 RandomMonad f1 = f2 = RandomMonad f3 where
   f3 a = f2f1 a (next a)
   RandomMonad f2f1 = f2 . f1


you need to make (RandomGen g) a constraint of the instance:

instance RandomGen g = Monad (RandomMonad g) where


Btw. RandomMonad looks like Control.Monad.Reader.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Newbie on instance of Monad

2008-10-31 Thread Henning Thielemann


On Fri, 31 Oct 2008, Jonathan Cast wrote:


On Fri, 2008-10-31 at 18:43 -0200, Mauricio wrote:

Hi,

After a lot of thinking, I can't get what I
am doing wrong in this code:

--
data ( RandomGen g ) = RandomMonad g a = RandomMonad (g - a)

instance Monad (RandomMonad g) where
   return = RandomMonad . const
   RandomMonad f1 = f2 = RandomMonad f3 where
 f3 a = f2f1 a (next a)
 RandomMonad f2f1 = f2 . f1


Yikes.  Just search the archives for `Set not a Monad'; you have the
same issue.


I think that this would be the answer if he is after a constraint for 'a', 
but he wants to constraint 'g'.



Hint: data RandomGen g = RandomMonad g a means nothing at all like what
you think it means.

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


Re: [Haskell-cafe] Newbie on instance of Monad

2008-10-31 Thread Jonathan Cast
On Fri, 2008-10-31 at 18:43 -0200, Mauricio wrote:
 Hi,
 
 After a lot of thinking, I can't get what I
 am doing wrong in this code:
 
 --
 data ( RandomGen g ) = RandomMonad g a = RandomMonad (g - a)
 
 instance Monad (RandomMonad g) where
return = RandomMonad . const
RandomMonad f1 = f2 = RandomMonad f3 where
  f3 a = f2f1 a (next a)
  RandomMonad f2f1 = f2 . f1
 --
 
 I get this error message:
 
 Could not deduce (RandomGen g)
   from the context (Monad (RandomMonad g))
   arising from a use of `RandomMonad' at src/encherDB.hs:10:11-21
Possible fix:
 add (RandomGen g) to the context of the type signature for `return'
  In the first argument of `(.)', namely `RandomMonad'
  In the expression: RandomMonad . const
  In the definition of `return': return = RandomMonad . const
 
 but I'm not smart enough to understand what
 it means.

Yikes.  Just search the archives for `Set not a Monad'; you have the
same issue.

Hint: data RandomGen g = RandomMonad g a means nothing at all like what
you think it means.

jcc


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


[Haskell-cafe] darcs hacking sprint #1 (report)

2008-10-31 Thread Eric Y. Kow
Dear Haskellers,

I thought some of you might be interested in our report from the darcs
hacking sprint, held on 25-26 October.  See also the blog version of it
at http://blog.darcs.net/2008/10/darcs-hacking-sprint-1-report.html
(it has photos).

So how did that darcs hacking sprint go?  Well, we had a lot of fun and
we got a lot of work done, so I think we can safely say that it was a
great success!

What next?  The sprint participants found themselves with a lot of good work
started that we simply couldn't put down, so we have continued hacking into
the week, turning many of our good starts into more concrete progress. There
is still a lot of work to do so we want to make sure we keep that momentum
going!  The big challenge right now is to get all of the patches reviewed and
merged back into darcs.net.  Unfortunately, this is creating a delay in the
usual patch review process as we clear our backlog.  In the meantime, please
continue sending your patches!

Thanks very much to David Roundy for his advice before the sprint and cheerful
handling of this patch influx; Galois, the University of Brighton and
Université de Paris 7 for graciously hosting our three venues; and especially
to everybody who participated or joined #darcs to cheer us on :-)

The next sprint will be held in conjunction with the Haskell Hackathon, March
2009 in Utrecht, Netherlands.  So see you in six months!

Overview

Total sprint patches: 234

Patches produced
 - during the sprint itself : 178
 - as follow-up work:  56

Patches sent and
 - accepted into darcs.net  :  43
 - awaiting review  : 191

(during defined as 25-27 October 2008 at 08:00 UTC)

Site reports

* Team Portland:
  - report: 
http://lists.osuosl.org/pipermail/darcs-users/2008-October/015082.html
  - pictures: 
http://blog.codersbase.com/2008/10/28/darcs-hacking-sprint-summary-from-portland-team/

* Team Brighton:
  - report: 
http://lists.osuosl.org/pipermail/darcs-users/2008-October/015122.html
  - pictures: 
http://koweycode.blogspot.com/2008/10/darcs-hacking-sprints-some-pictures.html
  - pictures: 
http://koweycode.blogspot.com/2008/10/darcs-hacking-sprint-team-brighton-day.html

* Team Paris:
  - report: 
http://lists.osuosl.org/pipermail/darcs-users/2008-October/015215.html

What we worked on
-

Warm up tasks
=
* Warn the user when the patch name looks like a command line option
   - http://bugs.darcs.net/issue395
   - Participants: Reinier Lamers (Team Paris)
   - Status: Accepted!
* Warn when tags are too short (length name 2)
   - http://bugs.darcs.net/issue1000
   - Participants: Christian Kellerman
   - Status: Accepted!

Optimisations
=
* Solved stack overflow when doing whatsnew on very large lines
   - http://bugs.darcs.net/issue1017
   - Participants: Ganesh Sittampalam (Team Brighton)
   - Status: awaiting review
* Smarter slurpies for faster directory lookups
   - http://bugs.darcs.net/issue711
   - Participants: Ganesh Sittampalam (Team Brighton)
   - Status: awaiting review
* Avoiding lstats in darcs whatsnew
   - http://bugs.darcs.net/issue390
   - Participants: Reinier Lamers (Team Paris)
   - Status: needs tweaking
* Bytestring optimisations
   - Participants: Don Stewart (Team Portland)
   - Status: awaiting review

Performance-related features

* Filecache to improve darcs annotate and darcs changes performance
   - Participants: Benedikt Schmidt
   - Status: still hacking!
* Packs
   - http://wiki.darcs.net/index.html/Packs_Specification
   - Participants: Nicolas Pouillard, Florent Becker (Team Paris)
   - Status: plan is fleshed out; implementation started in branch
* Chunky hunk representation
   - Participants: Ian Lynagh (Team Brighton)
   - Status: needs volunteer to start porting from camp to darcs
* Global cache: enabled by default and more portable
   - http://bugs.darcs.net/issue839
   - Participants: Simon Michael
   - Status: Accepted!
* Networking performance (Team Paris)
   - Used tcpdump to examine network performance problems
   - New issues filed:
  * http://bugs.darcs.net/issue1167 - darcs-transfer mode versions
  * http://bugs.darcs.net/issue1168 - ssh pipelining
  * http://bugs.darcs.net/issue1170 - Nagle's algorithm
   - Participants: Team Paris
   - Status: needs implementation!

Improved Windows support

* Bugs fixed:
   - newline endings on Windows for HTTP module.
   - http://bugs.darcs.net/issue774  - fix character echo on win32.
   - http://bugs.darcs.net/issue1023 - bracket file writing to prevent windows 
permission errors.
   - http://bugs.darcs.net/issue784  - fix file handle leak and check for 
exceptions on process running.
* Participants: Salvatore Insalaco
* Status: Accepted!

Infrastructure and cleanups
===
* Code cleanups
   - Added language pragmas in all files
   - Removed OldFastPackedString
   - Replaced FastPackedStrings api in 

Re: [Haskell-cafe] Re: Why 'round' does not just round numbers ?

2008-10-31 Thread Sterling Clover


On Oct 30, 2008, at 5:21 PM, Bertram Felgenhauer wrote:


George Pollard wrote:
There's also the ieee-utils package, which provides an IEEE monad  
with

`setRound`:

http://hackage.haskell.org/packages/archive/ieee-utils/0.4.0/doc/ 
html/Numeric-IEEE-RoundMode.html





When run with +RTS -N2 -RTS, the output randomly alternates
between Downward and ToNearest - for me at least.

The problem is that the setRound call will only affect one worker
thread, while the RTS will sometimes migrate RTS threads from one
worker to another.

runIEEE really has to be executed in a bound thread (see forkOS
documentation). Using `par` will also cause trouble - in fact even
more.



That's a really nice catch!

Dons has pointed out to me both the very handy forkOnIO which ensures  
the forked thread remains bound to a single CPU, and also the -qm  
flag to the RTS, which prevents thread migration between  
capabilities. Running the example program with +RTS -N2 -qm restores  
the behavior to what's intended. I'll try to get around to changing  
the documentation to reflect this. Also, it's worth noting that the  
IEEE round mode has no effect on rounding done with the `round`  
function, as that's explicitly coded to provide the behavior seen in  
the report.


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