Re: [Haskell-cafe] ghc-core 0.5 build fails

2010-01-27 Thread Ivan Lazar Miljenovic
Don Stewart writes: > Thanks for the report. ghc-core 0.5.1 was released today, so cabal > update; cabal install ghc-core and you should be fine. Even though I told you about this problem (your overly loose base constraint) four months ago? -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com Iv

Re: [Haskell-cafe] ghc-core 0.5 build fails

2010-01-27 Thread Don Stewart
briand: > Hi all, > > ghc-core.hs:263:13: > Not in scope: data constructor `C.ExitException' > > Looks like this comes from the base control.exception ? > > When I go to the web page for control.exception, there is no > exitexception. > > My reading of the hackage entry for ghc-core makes m

[Haskell-cafe] ghc-core 0.5 build fails

2010-01-27 Thread Brian Denheyer
Hi all, ghc-core.hs:263:13: Not in scope: data constructor `C.ExitException' Looks like this comes from the base control.exception ? When I go to the web page for control.exception, there is no exitexception. My reading of the hackage entry for ghc-core makes me think that I've got the corr

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Alexander Solla
On Jan 27, 2010, at 4:57 PM, Conor McBride wrote: Yes, the separation is not clear in Haskell. (I consider this unfortunate.) I was thinking of Paul Levy's call-by-push-value calculus, where the distinction is clear, but perhaps not as fluid as one might like. What, exactly, is the suppos

Re: [Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Twan van Laarhoven
Hans Aberg wrote: For example, in Map String Integer (sparse representation of monomials) compute the minimum value of all associative pairs with the same key (the gcd); if only one key is present, the absent should be treated as having value 0. So unionWith min xs ys will not work, because

Re: [Haskell-cafe] ANNOUNCE: ThreadScope 0.1

2010-01-27 Thread Johan Tibell
On Wed, Jan 27, 2010 at 8:51 AM, Satnam Singh wrote: > I’ve just released ThreadScope version 0.1 on Hackage. Threadscope is a > graphical utility for viewing profiling information about Haskell threads. > It was written jointly with Simon Marlow and Donnie Jones. It uses Gtk2HS so > it works un

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Conor McBride
On 27 Jan 2010, at 22:02, Daniel Fischer wrote: Am Mittwoch 27 Januar 2010 22:50:35 schrieb Conor McBride: It has been known to call such things 'computations', as opposed to 'values', and even to separate the categories of types and expressions which deliver the two. As usual, th

Re: [Haskell-cafe] Non-termination of type-checking

2010-01-27 Thread Matthew Brecknell
Ryan Ingram wrote: > The compiler doesn't loop for me with GHC6.10.4; I think GADTs still > had some bugs in GHC6.8. > > That said, this is pretty scary. Here's a simplified version that > shows this paradox with just a single GADT and no other extensions. > No use of "fix" or recursion anywhere!

Re: [Haskell-cafe] Non-termination of type-checking

2010-01-27 Thread Ryan Ingram
The compiler doesn't loop for me with GHC6.10.4; I think GADTs still had some bugs in GHC6.8. That said, this is pretty scary. Here's a simplified version that shows this paradox with just a single GADT and no other extensions. No use of "fix" or recursion anywhere! {-# LANGUAGE GADTs #-} module

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Daniel Fischer
Am Mittwoch 27 Januar 2010 22:50:35 schrieb Conor McBride: > > It has been known to call such things 'computations', as opposed to > 'values', and even to separate the categories of types and expressions > which deliver the two. As usual, that only works part of the time. [1,4,15,3,7] is not a co

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Conor McBride
Hi On 27 Jan 2010, at 20:14, Luke Palmer wrote: On Wed, Jan 27, 2010 at 11:39 AM, Jochem Berndsen wrote: Now, here's the question: Is is correct to say that [3, 5, 8] is a monad? In what sense would this be a monad? I don't quite get your question. I think the question is this: if m is

Re: [Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Hans Aberg
On 27 Jan 2010, at 21:29, Jan-Willem Maessen wrote: I'm thinking about (k -> Maybe a -> Maybe b -> Maybe c) -> Map k a -> Map k b -> Map k c The first two Maybe's tell if the keys are present, the last if one wants it in the resulting map. That has the same behavior semantically, but it's no

Re: [Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Jan-Willem Maessen
On Jan 27, 2010, at 10:54 AM, Hans Aberg wrote: > On 27 Jan 2010, at 16:33, Jan-Willem Maessen wrote: > >>> I'm not sure why you want to throw in functions between maps in the two >>> first arguments. Then there is no requirement that single keys are >>> preserved. >>> >>> But it is a good id

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Jochem Berndsen
Luke Palmer wrote: > On Wed, Jan 27, 2010 at 11:39 AM, Jochem Berndsen wrote: >>> Now, here's the question: Is is correct to say that [3, 5, 8] is a >>> monad? >> In what sense would this be a monad? I don't quite get your question. > > I think the question is this: if m is a monad, then what do

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Luke Palmer
On Wed, Jan 27, 2010 at 11:39 AM, Jochem Berndsen wrote: >> Now, here's the question: Is is correct to say that [3, 5, 8] is a >> monad? > > In what sense would this be a monad? I don't quite get your question. I think the question is this: if m is a monad, then what do you call a thing of type

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Holger Siegel
Am Mittwoch, den 27.01.2010, 21:19 +0300 schrieb Vladimir Matveev: > Oh yeah, it seems I found it. Solution is to use getModuleFileName and > getModuleHandle functions from System.Win32.DLL. Thanks for attention :) You can also use the (portable) package 'directory' from Hackage (http://hackage.ha

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Daniel Peebles
The list type constructor ([] :: * -> *) is a functor, and if you add the implementations of join/return (or just return and bind) those together make the monad. The value-level list [3,5,8] is just a list :) On Wed, Jan 27, 2010 at 1:30 PM, Andrew Coppin wrote: > Here's one for you to ponder. >

Re: [Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Jochem Berndsen
Andrew Coppin wrote: >> 7 is a number. 7 is an integer, and integers are numbers. > > 7 is not a field. 7 is an element of [at least one] field, but 7 itself > is not a field. > > 7 is not a group. Why not? It might be useful to use the notation '7' for the cyclic group with 7 elements. > 7 is

[Haskell-cafe] Linguistic hair-splitting

2010-01-27 Thread Andrew Coppin
Here's one for you to ponder. 7 is a number. 7 is an integer, and integers are numbers. 7 is not a field. 7 is an element of [at least one] field, but 7 itself is not a field. 7 is not a group. 7 is a member of the set of integers, but the set of integers is not a group either. The set of in

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Vladimir Matveev
Oh yeah, it seems I found it. Solution is to use getModuleFileName and getModuleHandle functions from System.Win32.DLL. Thanks for attention :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Vladimir Matveev
Thanks, but my program will be distributed in self-made installer (on windows), though I'm using cabal and the sources are GPL-licensed. Just for users' convenience :) On Wed, Jan 27, 2010 at 09:42:45AM -0800, Thomas DuBuisson wrote: > Other responses have been great but if you are cabalizing you

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Vladimir Matveev
Program directory is not system directory. So it doesn't have CSIDL. Program directory is the folder where executable file is located. I certainly remember that there is a way to get it without, for example, setting it in registry during install... On Wed, Jan 27, 2010 at 12:31:19PM -0500, Rahul K

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Thomas DuBuisson
Other responses have been great but if you are cabalizing you might also be interested in: http://neilmitchell.blogspot.com/2008/02/adding-data-files-using-cabal.html Cheers, Thomas On Wed, Jan 27, 2010 at 9:06 AM, Matveev Vladimir wrote: > Hi, > I'm writing cross-platform application in Haskel

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Rahul Kapoor
> So, is there a way to get an application > directory path under Windows? I remember that there is a way to do this > using WinAPI, but how to do this Haskell? The System.Directory module has some methods to get specific directory names in an OS agnostic manner. The closest method that matches w

Re: [Haskell-cafe] Determining application directory

2010-01-27 Thread Chris Eidhof
Hi Matveev, You might be interested in the System.Directory module: http://hackage.haskell.org/packages/archive/directory/1.0.0.3/doc/html/System-Directory.html HTH, -chris On 27 jan 2010, at 18:06, Matveev Vladimir wrote: > Hi, > I'm writing cross-platform application in Haskell which should

[Haskell-cafe] Determining application directory

2010-01-27 Thread Matveev Vladimir
Hi, I'm writing cross-platform application in Haskell which should be running under Windows and Linux. Under Linux configuration is stored in the /etc directory, and under Windows configuration is meant to be in the application directory. So, is there a way to get an application directory path unde

[Haskell-cafe] ANNOUNCE: ThreadScope 0.1

2010-01-27 Thread Satnam Singh
I've just released ThreadScope version 0.1 on Hackage. Threadscope is a graphical utility for viewing profiling information about Haskell threads. It was written jointly with Simon Marlow and Donnie Jones. It uses Gtk2HS so it works under Windows and the L-word operating system although there se

[Haskell-cafe] Non-termination of type-checking

2010-01-27 Thread Matthieu Sozeau
Dear Haskellers, while trying to encode a paradox recently found in Coq if one has impredicativity and adds injectivity of type constructors [1] I stumbled on an apparent loop in the type checker when using GADTs, Rank2Types and EmptyDataDecls. > {-# OPTIONS -XGADTs -XRank2Types -XEmptyDataDec

Re: [Haskell-cafe] scheduling an alarm

2010-01-27 Thread Thomas DuBuisson
On Wed, Jan 27, 2010 at 7:31 AM, Brian Denheyer wrote: > On Tue, 26 Jan 2010 22:41:44 -0800 > Thomas DuBuisson wrote: > > > Brian Denheyer wrote: > > > > > On Tue, 26 Jan 2010 10:54:03 -0800 > > > Thomas DuBuisson wrote: > > > > > > > > doEvent f usDelay = forkIO $ > > > > > threadDelay usDe

Re: [Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Hans Aberg
On 27 Jan 2010, at 16:33, Jan-Willem Maessen wrote: I'm not sure why you want to throw in functions between maps in the two first arguments. Then there is no requirement that single keys are preserved. But it is a good idea to have a Maybe so that one can remove keys on the fly. A good

Re: [Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Jan-Willem Maessen
On Jan 27, 2010, at 9:42 AM, Hans Aberg wrote: > On 27 Jan 2010, at 14:56, Jan-Willem Maessen wrote: > >>> So here, one would want: >>> (a -> c) -> (b -> c) -> (a -> b -> c) -> Map k a -> Map k b -> Map k c >>> where the two first functions are applied when the first or second key is >>> missin

Re: [Haskell-cafe] scheduling an alarm

2010-01-27 Thread Brian Denheyer
On Tue, 26 Jan 2010 22:41:44 -0800 Thomas DuBuisson wrote: > Brian Denheyer wrote: > > > On Tue, 26 Jan 2010 10:54:03 -0800 > > Thomas DuBuisson wrote: > > > > > > doEvent f usDelay = forkIO $ > > > > threadDelay usDelay > > > > doEvent f usDelay > > > > f > > > > Are you sure that's rig

Re: [Haskell-cafe] Supporting GHC 6.10 and 6.12 in HDBC-postgresql Setup.hs

2010-01-27 Thread John Goerzen
Neil Mitchell wrote: >> The other HDBC problem I have is various dependencies relying on QC1. >> >> The next HP will ship with QC 2.1 (in coming weeks), so it might be a >> good time for people to start migrating, since that will be the only >> version of QC on many distros. > > I would strongly s

Re: [Haskell-cafe] Re: wxHaskell - using XRC files

2010-01-27 Thread Jeremy O'Donoghue
Hi Guenther, Gour On Wed, 27 Jan 2010 13:38 +0100, "Gour" wrote: > On Wed, 27 Jan 2010 11:09:06 +0100 > >> "Günther" == Günther Schmidt wrote: > > Günther> I'm looking for documentation on using XRC files with > Günther> wxHaskell. > > I'd like to find it too...so, far I've found only two

Re: [Haskell-cafe] Supporting GHC 6.10 and 6.12 in HDBC-postgresql Setup.hs

2010-01-27 Thread Neil Mitchell
> The other HDBC problem I have is various dependencies relying on QC1. > > The next HP will ship with QC 2.1 (in coming weeks), so it might be a > good time for people to start migrating, since that will be the only > version of QC on many distros. I would strongly suggest moving to QC 2 for othe

Re: [Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Hans Aberg
On 27 Jan 2010, at 14:56, Jan-Willem Maessen wrote: So here, one would want: (a -> c) -> (b -> c) -> (a -> b -> c) -> Map k a -> Map k b -> Map k c where the two first functions are applied when the first or second key is missing. Ah, the swiss army knife function on maps. This particular

[Haskell-cafe] Re: wxHaskell - using XRC files

2010-01-27 Thread Gour
On Wed, 27 Jan 2010 14:56:28 +0100 >> "Günther" == Günther Schmidt wrote: Günther> creating the .xrc files with WxFormBuilder isn't the problem, Günther> I'd need to see the .hs files where these resources are Günther> imported and used. Do you happen to know where to find those Günther> too?

[Haskell-cafe] Re: wxHaskell - using XRC files

2010-01-27 Thread Günther Schmidt
Hello Gour, creating the .xrc files with WxFormBuilder isn't the problem, I'd need to see the .hs files where these resources are imported and used. Do you happen to know where to find those too? Günther Am 27.01.10 13:38, schrieb Gour: On Wed, 27 Jan 2010 11:09:06 +0100 "Günther" == Günth

Re: [Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Jan-Willem Maessen
On Jan 27, 2010, at 5:53 AM, Hans Aberg wrote: > I need ideally some generalizations of unionWith and unionWithKey, for > efficiency matters (i.e. avoiding conversions and traversing the maps more > than once). I could use a modification of the code in Map.hs, but then the > problem is that th

[Haskell-cafe] Re: wxHaskell - using XRC files

2010-01-27 Thread Gour
On Wed, 27 Jan 2010 11:09:06 +0100 >> "Günther" == Günther Schmidt wrote: Günther> I'm looking for documentation on using XRC files with Günther> wxHaskell. I'd like to find it too...so, far I've found only two samples: xrcmenu.xrc & controls.xrc. Günther> BTW: I'm using wxFormBuilder, any

[Haskell-cafe] custom widgets

2010-01-27 Thread Andrew U. Frank
we used wx originally but switched to gtk. the great advantage is glade... which is very flexible and still you can add/change whatever you need to in gtk in your haskell code. we checked porting between linux (ubuntu) and windows (xp) and encountered no problems.

[Haskell-cafe] Map unionWith generalization

2010-01-27 Thread Hans Aberg
I need ideally some generalizations of unionWith and unionWithKey, for efficiency matters (i.e. avoiding conversions and traversing the maps more than once). I could use a modification of the code in Map.hs, but then the problem is that the module Map interface does not export the construct

[Haskell-cafe] wxHaskell - using XRC files

2010-01-27 Thread Günther Schmidt
Hi, I'm looking for documentation on using XRC files with wxHaskell. I finally managed to cabal-install wxHaskell last night alas sans docs. Günther BTW: I'm using wxFormBuilder, any other good tools out there? ___ Haskell-Cafe mailing list Haskell

Re: [Haskell-cafe] Re: classes with types which are wrapped in

2010-01-27 Thread Stephen Tetley
2010/1/27 Andrew U. Frank : {Snip] > dotoBfield :: (b -> b) -> X a b c -> X a b c > dotoBfield  op x = x { bfield = op (bfield x)} > > and similar for A and C. > > is there a better idiom to achieve the same effect? > can this be automated (for example, using generics)? Hello Andrew I use a fam

[Haskell-cafe] Re: classes with types which are wrapped in

2010-01-27 Thread Andrew U. Frank
i thank for the two suggestions (newtype as a wrapper and type families) and i have explored them. haskell-cafe was very helpful! i use often a piece of code to update a part of a record with field names which codes as follows: data X a b c = X {afield :: a, bfield :: b, cfield :: c} dotoBfie