Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Antoine Latter
On Sat, Dec 25, 2010 at 1:31 AM, Eugene Kirpichov wrote: > Great! > Antoine, would you perhaps then update the cabal description of the > package to include the word "endianness" in it? I Ctrl+F-ed "endian" > through hackage before writing storable-endian and did not find your > package. > It is

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Eugene Kirpichov
Great! Antoine, would you perhaps then update the cabal description of the package to include the word "endianness" in it? I Ctrl+F-ed "endian" through hackage before writing storable-endian and did not find your package. 2010/12/25 Antoine Latter : > On Fri, Dec 24, 2010 at 8:08 AM, Henk-Jan van

Re: [Haskell-cafe] GHC-7.01 and intrinsic operations

2010-12-24 Thread Pavel Perikov
On 25.12.2010, at 0:20, Henning Thielemann wrote: > On 13.12.2010 16:38, Pavel Perikov wrote: >> Is it possible to make GHC-7.0.1 to generate intrinsic instructions instead >> of calls to C library to compute trigonometric functions? >> > As far as I remember GHC generates FPU instructions for

Re: [Haskell-cafe] Misleading MVar documentation

2010-12-24 Thread Mitar
Hi! On Sat, Dec 25, 2010 at 2:32 AM, Edward Z. Yang wrote: > In particular, we should explicitly note the race conditions > for not just swapMVar but also readMVar, withMVar, modifyMVar_ and modifyMVar, I am not sure if this are really race conditions? The point is that readMVar, withMVar and ot

Re: [Haskell-cafe] Misleading MVar documentation

2010-12-24 Thread Jason Dagit
On Fri, Dec 24, 2010 at 5:32 PM, Edward Z. Yang wrote: > Merry Christmas all! > > Is it just me, or does the Control.Concurrent.MVar documentation seem a bit > misleading? In particular, we should explicitly note the race conditions > for not just swapMVar but also readMVar, withMVar, modifyMVar

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Antoine Latter
On Fri, Dec 24, 2010 at 8:08 AM, Henk-Jan van Tuyl wrote: > > You could use ADNS.Endian.endian from package hsdns in your Setup.hs to > define endianness at compile time. > > Regards, > Henk-Jan van Tuyl > It looks like I've reimplemented the same thing in its own package: http://hackage.haskell.

Re: [Haskell-cafe] Misleading MVar documentation

2010-12-24 Thread Edward Z. Yang
Here is one suggested doc patch. Comments and revisions welcome: ezy...@javelin:~/Dev/ghc-clean/libraries/base/Control/Concurrent$ darcs whatsnew -u hunk ./Control/Concurrent/MVar.hs 59 {-| This is a combination of 'takeMVar' and 'putMVar'; ie. it takes the value - from the 'MVar', puts i

Re: [Haskell-cafe] Misleading MVar documentation

2010-12-24 Thread Don Stewart
ezyang: > Merry Christmas all! > > Is it just me, or does the Control.Concurrent.MVar documentation seem a bit > misleading? In particular, we should explicitly note the race conditions > for not just swapMVar but also readMVar, withMVar, modifyMVar_ and modifyMVar, > and clarify that the safety

Re: [Haskell-cafe] [darcs-users] Darcs failure

2010-12-24 Thread Gregory Crosswhite
On 12/24/10 4:08 PM, Andrew Coppin wrote: Gotta love the way that this is THE MOST COMMON USE CASE for kill, and yet kill itself doesn't support doing this. The problem with killing processes by name is that names aren't unique, so you might unintentionally end up killing other processes that

Re: [Haskell-cafe] The Bay Area Haskell Hackathon is coming up: Feb 11-13, 2011

2010-12-24 Thread Alan Shaw
I'm a beginner in Haskell (you can see where I'm at from my blog post Haskell Liftoff ) and I want to learn more, but I'm not sure what a hackathon is. Please advise :) On Thu, Dec 23, 2010 at 2:48 PM, Bryan O'Sullivan wrote: > Mark Lentczner

[Haskell-cafe] Misleading MVar documentation

2010-12-24 Thread Edward Z. Yang
Merry Christmas all! Is it just me, or does the Control.Concurrent.MVar documentation seem a bit misleading? In particular, we should explicitly note the race conditions for not just swapMVar but also readMVar, withMVar, modifyMVar_ and modifyMVar, and clarify that the safety guarantees of the la

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread wren ng thornton
On 12/23/10 9:41 PM, Daniel Peebles wrote: For me, mostly naming. Cofunctor isn't the right name for it, and comap, while short, feels wrong. Contrafunctor feels better but is also cumbersome. No problems with Comonad, though. It is wrong. Cofunctors are exactly functors. It's unfortunate that

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread wren ng thornton
On 12/24/10 12:26 AM, C. McCann wrote: As far as I understand (which may not actually be all that far), contravariant functors just go to or from an opposite category, a distinction that is purely a matter of definition, not anything intrinsic. Yes. On the other hand, Applicative and Monad ar

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread wren ng thornton
On 12/23/10 11:46 PM, Mario Blažević wrote: On Thu, Dec 23, 2010 at 11:25 PM, Tony Morris wrote: ...regardless of the utility of a contravariant functor type-class, I strongly advocate for calling it Contrafunctor and not Cofunctor. I have seen numerous examples of confusion over this, particu

Re: [Haskell-cafe] instance for (Show ([(String, Int)] -> Int))

2010-12-24 Thread Daniel Fischer
On Saturday 25 December 2010 00:32:38, Aaron Gray wrote: > Okay great, works this end too, but what does the 'flip' do ??? It flips the order of arguments to calc. You could also write main = getContents >>= print . (`calc` []) . lexer Generally, flip f = \x y -> f y x or flip f x = \y -> f y

Re: [Haskell-cafe] instance for (Show ([(String, Int)] -> Int))

2010-12-24 Thread Aaron Gray
On 24 December 2010 22:07, Daniel Fischer wrote: > On Friday 24 December 2010 22:47:55, Aaron Gray wrote: > > On 24 December 2010 18:24, Henning Thielemann > > > > > > wrote: > > > > > > > > > On Fri, 24 Dec 2010, Aaron Gray wrote: > > > > > > The compiler is requesting an instance declaration f

Re: [Haskell-cafe] Cabal message problem.

2010-12-24 Thread Henning Thielemann
On 16.12.2010 15:40, Duncan Coutts wrote: On 16 December 2010 13:38, Daniel Fischer wrote: Maybe a flag "ignore upper bounds and try with the latest" for cabal would be a solution. Would that be hard to implement or easy? That suggestion has come up quite a few times. I think it's probably

Re: [Haskell-cafe] instance for (Show ([(String, Int)] -> Int))

2010-12-24 Thread Daniel Fischer
On Friday 24 December 2010 22:47:55, Aaron Gray wrote: > On 24 December 2010 18:24, Henning Thielemann > > > wrote: > > > > > > On Fri, 24 Dec 2010, Aaron Gray wrote: > > > > The compiler is requesting an instance declaration for Show :- > > > >> expr-eval.hs:334:23: > >> No instance for

Re: [Haskell-cafe] instance for (Show ([(String, Int)] -> Int))

2010-12-24 Thread Aaron Gray
On 24 December 2010 18:24, Henning Thielemann wrote: > > On Fri, 24 Dec 2010, Aaron Gray wrote: > > The compiler is requesting an instance declaration for Show :- >> >> expr-eval.hs:334:23: >> No instance for (Show ([(String, Int)] -> Int)) >> arising from a use of `print' at exp

Re: [Haskell-cafe] GHC-7.01 and intrinsic operations

2010-12-24 Thread Henning Thielemann
On 13.12.2010 16:38, Pavel Perikov wrote: Is it possible to make GHC-7.0.1 to generate intrinsic instructions instead of calls to C library to compute trigonometric functions? main = do a<- readLn print $ sin a I tried -O -msse2 -fllvm and their combinations. Generating asse

Re: [Haskell-cafe] [darcs-users] Darcs failure

2010-12-24 Thread Andrew Coppin
On 24/12/2010 09:58 AM, Miles Gould wrote: Hi Andrew, Others have probably told you this, Actually no... but you should look into the pkill command, which allows you to kill processes (including sending signals other than SIGTERM) by name. It's installed by default on Ubuntu. Mmm, OK. Than

Re: [Haskell-cafe] GHC 7.0.1 developer challenges

2010-12-24 Thread John D. Ramsdell
On Fri, Dec 17, 2010 at 3:03 AM, Ketil Malde wrote: > > So I still think the 80% rule is pretty good - it's simple, and > although it isn't optimal in all cases, it's conservative in that any > larger bound is almost certainly going to thrash. Did you get a chance to test the 80% rule? Was I rig

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Daniel Peebles
I remember seeing this very discussion about pointed being disjoint from functor just recently on one of the various haskell mailing lists. But as for my opinion on it, because there's no real way of specifying any laws for pointed without functor. With functor and pointed, you can say that you exp

Re: [Haskell-cafe] instance for (Show ([(String, Int)] -> Int))

2010-12-24 Thread Henning Thielemann
On Fri, 24 Dec 2010, Aaron Gray wrote: The compiler is requesting an instance declaration for Show :-   expr-eval.hs:334:23:       No instance for (Show ([(String, Int)] -> Int))         arising from a use of `print' at expr-eval.hs:334:23-27       Possible fix:         add an instance declara

Re: [Haskell-cafe] instance for (Show ([(String, Int)] -> Int))

2010-12-24 Thread Henning Thielemann
On Fri, 24 Dec 2010, Aaron Gray wrote: How do I code an 'instance' declaration for '(Show ([(String, Int)] -> Int))'. You ask for displaying a function that maps from [(String, Int)] to Int. What shall the generated text look like? ___ Haskell-Ca

[Haskell-cafe] instance for (Show ([(String, Int)] -> Int))

2010-12-24 Thread Aaron Gray
How do I code an 'instance' declaration for '(Show ([(String, Int)] -> Int))'. I am new to instance declarations and am following the Happy examples :- http://www.haskell.org/happy/doc/html/sec-using.html#sec-other-datatypes The compiler is requesting an instance declaration for Show :- e

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Mario Blažević
On Fri, Dec 24, 2010 at 7:43 AM, Maciej Piechotka wrote: > On Fri, 2010-12-24 at 05:36 -0500, Edward Kmett wrote: > > > > +1 for adding Comonads. As an aside, since Haskell doesn't have (nor > > could it have) coexponential objects, there is no 'missing' > > Coapplicative concept that goes with it

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Mario Blažević
On Fri, Dec 24, 2010 at 5:36 AM, Edward Kmett wrote: > +1 for adding a Contrafunctor/ContraFunctor to base somewhere. But I agree > completely with Tony, please call it contramap. ;) Otherwise people will > wonder why comonads are not cofunctors -- a matter which can be cleared up > by avoiding s

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Peter Simons
Hi guys, >> You could use ADNS.Endian.endian from package hsdns in your Setup.hs >> to define endianness at compile time. > > Cool, it's already there! However I would not recommend to let a > low-level library depend on a higher-level one. I think it would be > cleaner to move the ADNS.Endi

[Haskell-cafe] Gedit Haskell mode plugin indentation

2010-12-24 Thread yukkuri yu!yu!yu!
Here is my first try to write a Haskell mode layout indentation plugin for gedit - GNOME Text Editor: ftp://neverb.net/soft/mine/gedit_haskell_mode/haskell_indentation-latest.tar.gz Curent version: v0.4 To install the plugin 1) Create directory ~/.gnome2/gedit/plugins 2) Copy tarball/plugin/* co

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Henning Thielemann
On Fri, 24 Dec 2010, Henk-Jan van Tuyl wrote: You could use ADNS.Endian.endian from package hsdns in your Setup.hs to define endianness at compile time. Cool, it's already there! However I would not recommend to let a low-level library depend on a higher-level one. I think it would be cleane

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Eugene Kirpichov
They really weren't - I exported them according to your and Hennig's advice. 2010/12/24 Gábor Lehel : > 2010/12/24 Henning Thielemann : >> >> On Fri, 24 Dec 2010, Gábor Lehel wrote: >> >>> One further idea -- assuming HasBigEndian and HasLittleEndian are >>> unexported because you don't want peopl

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Gábor Lehel
2010/12/24 Henning Thielemann : > > On Fri, 24 Dec 2010, Gábor Lehel wrote: > >> One further idea -- assuming HasBigEndian and HasLittleEndian are >> unexported because you don't want people writing new instances > > Why should people not write further instances? I could write a > LittleEndianStora

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Henk-Jan van Tuyl
On Fri, 24 Dec 2010 11:36:23 +0100, Eugene Kirpichov wrote: Hello, 2010/12/24 Henning Thielemann : : : Maybe you succeed to find out machine endianess at compile time. Then you could use native memory access if the user requested endianess is the one of the machine. If you achieve thi

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Maciej Piechotka
On Fri, 2010-12-24 at 05:36 -0500, Edward Kmett wrote: > > +1 for adding Comonads. As an aside, since Haskell doesn't have (nor > could it have) coexponential objects, there is no 'missing' > Coapplicative concept that goes with it, so there can be no objection > on the grounds of lack of symmetry

Re: [Haskell-cafe] parsec2 vs. parsec3... again

2010-12-24 Thread Maciej Piechotka
On Thu, 2010-12-23 at 18:38 +0200, Michael Snoyman wrote: > On Thu, Dec 23, 2010 at 6:21 PM, Johan Tibell wrote: > > On Thu, Dec 23, 2010 at 3:03 PM, Felipe Almeida Lessa > > wrote: > >> Michael Snoyman wants attoparsec-text as well [1]. > >> > >> [1] http://docs.yesodweb.com/blog/wishlist/ > > >

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Henning Thielemann
On Fri, 24 Dec 2010, Eugene Kirpichov wrote: I don't think I'd like to allocate memory in these functions - I expect them to have very predictable and very high performance. I'm afraid on ix86 it is not possible to move a Double that is stored in (two 32 bit) general purpose registers over t

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Edward Kmett
+1 for adding a Contrafunctor/ContraFunctor to base somewhere. But I agree completely with Tony, please call it contramap. ;) Otherwise people will wonder why comonads are not cofunctors -- a matter which can be cleared up by avoiding sloppy terminology. +1 for adding Comonads. As an aside, since

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Eugene Kirpichov
Hello, 2010/12/24 Henning Thielemann : > > On Fri, 24 Dec 2010, Eugene Kirpichov wrote: > >> I've released storable-endian 0.2.0, which does not use TH and bases >> on your suggestion (though it has a bit of boilerplate because of >> abandoning TH, but I don't think that's critical). > > Great, th

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Stephen Tetley
On 24 December 2010 02:16, Mario Blažević wrote: > To turn the proof obligation around, what could possibly be the downside of > adding a puny Cofunctor class to the base library? Hi Mario For the record I'm personally neutral on Cofunctor and on balance would like to see Comonad added to Base.

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Henning Thielemann
On Fri, 24 Dec 2010, Gábor Lehel wrote: One further idea -- assuming HasBigEndian and HasLittleEndian are unexported because you don't want people writing new instances Why should people not write further instances? I could write a LittleEndianStorable instance for fixed point numbers, long

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Henning Thielemann
On Fri, 24 Dec 2010, Eugene Kirpichov wrote: I've released storable-endian 0.2.0, which does not use TH and bases on your suggestion (though it has a bit of boilerplate because of abandoning TH, but I don't think that's critical). Great, this should make it also usable on JHC (I have not test

Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-24 Thread Gábor Lehel
One further idea -- assuming HasBigEndian and HasLittleEndian are unexported because you don't want people writing new instances -- is to have something like class HasBigEndianPrivate => HasBigEndian instead, with the latter exported and the former not, and instances of each for the same types. Wha