[Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
Hi, I have been using ghc-mod for a long time and I can’t give it up now, but I have an annoying problem. When I have a cabal file with a library and an executable depending on the library (for example here https://github.com/bitonic/kant/blob/master/kant.cabal), ghc-mod is not happy,

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread CJ van den Berg
Hi Francesco, To keep ghc-mod happy, you also have to keep ghci happy. What you probably need is a .ghci file in the directory with a :set -isrc line in it. You may also need to add other stuff to .ghci such as language extensions and whatever else is needed to load your project with ghci.

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
At Fri, 08 Feb 2013 11:11:06 +0100, CJ van den Berg wrote: Hi Francesco, To keep ghc-mod happy, you also have to keep ghci happy. What you probably need is a .ghci file in the directory with a :set -isrc line in it. You may also need to add other stuff to .ghci such as language extensions

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread CJ van den Berg
On 08/02/13 11:20, Francesco Mazzoli wrote: At Fri, 08 Feb 2013 11:11:06 +0100, CJ van den Berg wrote: To keep ghc-mod happy, you also have to keep ghci happy. What you probably need is a .ghci file in the directory with a :set -isrc line in it. You may also need to add other stuff to .ghci

Re: [Haskell-cafe] Extensible Type Unification

2013-02-08 Thread Leon Smith
It finally occurred to me how to get most of what I want, at least from a functional perspective.Here's a sample GADT, with four categories of constructor: data Foo :: Bool - Bool - Bool - Bool - * where A :: Foo True b c d B :: Foo True b c d C :: Foo a True c d D :: Foo a

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
At Fri, 08 Feb 2013 11:39:19 +0100, CJ van den Berg wrote: I downloaded your package and tried it. It does work. So, what I have is bitonic@clay ~/src/kant (git)-[master] % cat .ghci :set -isrc And I still get the mentioned error. Did you take any other measures to make things work?

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Ivan Lazar Miljenovic
On 8 February 2013 22:25, Francesco Mazzoli f...@mazzo.li wrote: At Fri, 08 Feb 2013 11:39:19 +0100, CJ van den Berg wrote: I downloaded your package and tried it. It does work. So, what I have is bitonic@clay ~/src/kant (git)-[master] % cat .ghci :set -isrc Try also having :set

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread CJ van den Berg
On 08/02/13 12:25, Francesco Mazzoli wrote: At Fri, 08 Feb 2013 11:39:19 +0100, CJ van den Berg wrote: I downloaded your package and tried it. It does work. So, what I have is bitonic@clay ~/src/kant (git)-[master] % cat .ghci :set -isrc And I still get the mentioned error. Did

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread 山本和彦
Hi, When I have a cabal file with a library and an executable depending on the library (for example here https://github.com/bitonic/kant/blob/master/kant.cabal), ghc-mod is not happy, complaining in every file that Error:command line: cannot satisfy -package kant Where ‘kant’ is

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
At Fri, 08 Feb 2013 21:22:23 +0900 (JST), Kazu Yamamoto (山本和彦) wrote: I guess you don't install the kant library, right? If so, I will think how to treat this kind problem. The ‘kant’ package is the package I’m developing and using ghc-mod on. It includes both a library and an executable.

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
At Fri, 08 Feb 2013 12:50:47 +0100, CJ van den Berg wrote: On 08/02/13 12:25, Francesco Mazzoli wrote: At Fri, 08 Feb 2013 11:39:19 +0100, CJ van den Berg wrote: I downloaded your package and tried it. It does work. So, what I have is bitonic@clay ~/src/kant (git)-[master] %

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread 山本和彦
The ‘kant’ package is the package I’m developing and using ghc-mod on. Yes. I understand it. It includes both a library and an executable. The executable target has ‘kant’ as a dependency. What I asked is whether or not the kant library is installed by cabal. To edit a Haskell file for

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
At Fri, 08 Feb 2013 22:18:20 +0900 (JST), Kazu Yamamoto (山本和彦) wrote: The ‘kant’ package is the package I’m developing and using ghc-mod on. Yes. I understand it. It includes both a library and an executable. The executable target has ‘kant’ as a dependency. What I asked is

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread 山本和彦
Well installing it has the big problem that each time I make a change to the interface I have to manually re-install, and this happens often since I’m in an early stage... I'm not saying that you should install it. But I just want to know your situation. Right, but this is surely doable

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
At Fri, 08 Feb 2013 22:39:07 +0900 (JST), Kazu Yamamoto (山本和彦) wrote: Well installing it has the big problem that each time I make a change to the interface I have to manually re-install, and this happens often since I’m in an early stage... I'm not saying that you should install it.

Re: [Haskell-cafe] ghc-mod and cabal targets

2013-02-08 Thread Francesco Mazzoli
At Fri, 08 Feb 2013 13:43:12 +, Francesco Mazzoli wrote: At Fri, 08 Feb 2013 22:39:07 +0900 (JST), Kazu Yamamoto (山本和彦) wrote: Well installing it has the big problem that each time I make a change to the interface I have to manually re-install, and this happens often since I’m

[Haskell-cafe] cabal-dev add-source

2013-02-08 Thread JP Moresmau
Hello, I'm trying to understand cabal-dev, and I seem to be missing some basic point, because I can't get dependencies between projects working properly. I have two projects, let's call them P1 and P2. P2 depends on P1, as indicated by its cabal file build-depends field. I run cabal-dev add-source

Re: [Haskell-cafe] arrow notation

2013-02-08 Thread Ross Paterson
The proposed changes are described here: http://hackage.haskell.org/trac/ghc/wiki/ArrowNotation ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] cabal-dev add-source

2013-02-08 Thread Blake Rain
You need to call cabal-dev add-source on P1 again to copy over the sdist, then do a cabal-dev install. See notes under Using a sandbox-local Hackage on https://github.com/creswick/cabal-dev On Feb 8, 2013 2:22 PM, JP Moresmau jpmores...@gmail.com wrote: Hello, I'm trying to understand

Re: [Haskell-cafe] cabal-dev add-source

2013-02-08 Thread Johan Tibell
On Fri, Feb 8, 2013 at 9:53 AM, Blake Rain blake.r...@gmail.com wrote: You need to call cabal-dev add-source on P1 again to copy over the sdist, then do a cabal-dev install. See notes under Using a sandbox-local Hackage on

Re: [Haskell-cafe] cabal-dev add-source

2013-02-08 Thread JP Moresmau
That's exactly what I'm doing, and I was exactly following these notes, but it doesn't work. This google+ post and the answers to it ( https://plus.google.com/102016502921512042165/posts/TGaENqWfubP) lead me to at least one solution that seems to work: you need to unregister the changed package

Re: [Haskell-cafe] cabal-dev add-source

2013-02-08 Thread JP Moresmau
Johan, thanks, that brings me to a point that I wanted to raise. I'm playing with cabal-dev because users have asked me to add support for it in EclipseFP (so projects could have their own sandbox and have dependencies between projects without polluting the main package databases). It is worth it,

Re: [Haskell-cafe] cabal-dev add-source

2013-02-08 Thread Johan Tibell
On Fri, Feb 8, 2013 at 10:07 AM, JP Moresmau jpmores...@gmail.com wrote: Johan, thanks, that brings me to a point that I wanted to raise. I'm playing with cabal-dev because users have asked me to add support for it in EclipseFP (so projects could have their own sandbox and have dependencies

Re: [Haskell-cafe] cabal-dev add-source

2013-02-08 Thread Ozgun Ataman
On Friday, February 8, 2013 at 1:19 PM, Johan Tibell wrote: On Fri, Feb 8, 2013 at 10:07 AM, JP Moresmau jpmores...@gmail.com (mailto:jpmores...@gmail.com) wrote: Johan, thanks, that brings me to a point that I wanted to raise. I'm playing with cabal-dev because users have asked me to

[Haskell-cafe] ICFP 2013: Call for papers

2013-02-08 Thread David Van Horn
= 18th ACM SIGPLAN International Conference on Functional Programming ICFP 2013 Boston, MA, USA, 25-27 September 2013 http://www.icfpconference.org/icfp2013

Re: [Haskell-cafe] cabal-dev add-source

2013-02-08 Thread Johan Tibell
On Fri, Feb 8, 2013 at 10:24 AM, Ozgun Ataman ozata...@gmail.com wrote: Which, thanks to Johan's help yesterday, can still be worked around (for now) by starting ghci with: ghci -package-conf ./cabal-sandbox/your-package-conf-folder-here/ You can indeed do this. For real ghci support in

[Haskell-cafe] performance question

2013-02-08 Thread Nicolas Bock
Hi list, I wrote a script that reads matrix elements from standard input, parses the input using a regular expression, and then bins the matrix elements by magnitude. I wrote the same script in python (just to be sure :) ) and find that the python version vastly outperforms the Haskell script.

Re: [Haskell-cafe] performance question

2013-02-08 Thread Aleksey Khudyakov
On 08.02.2013 23:26, Nicolas Bock wrote: Hi list, I wrote a script that reads matrix elements from standard input, parses the input using a regular expression, and then bins the matrix elements by magnitude. I wrote the same script in python (just to be sure :) ) and find that the python

Re: [Haskell-cafe] performance question

2013-02-08 Thread Bob Ippolito
Do you mind posting createMatrixDump.py and printMatrixDecay.py? That would certainly make it easier to help you. On Fri, Feb 8, 2013 at 11:26 AM, Nicolas Bock nicolasb...@gmail.com wrote: Hi list, I wrote a script that reads matrix elements from standard input, parses the input using a

Re: [Haskell-cafe] performance question

2013-02-08 Thread Nicolas Bock
Sorry, should have done this right away. Here are the other two scripts. On Fri, Feb 8, 2013 at 1:45 PM, Bob Ippolito b...@redivi.com wrote: Do you mind posting createMatrixDump.py and printMatrixDecay.py? That would certainly make it easier to help you. On Fri, Feb 8, 2013 at 11:26 AM,

Re: [Haskell-cafe] performance question

2013-02-08 Thread Nicolas Bock
On Fri, Feb 8, 2013 at 1:23 PM, Aleksey Khudyakov alexey.sklad...@gmail.com wrote: On 08.02.2013 23:26, Nicolas Bock wrote: Hi list, I wrote a script that reads matrix elements from standard input, parses the input using a regular expression, and then bins the matrix elements by

Re: [Haskell-cafe] performance question

2013-02-08 Thread Aleksey Khudyakov
On 09.02.2013 01:02, Nicolas Bock wrote: Yes, a histogram. The binning code is really a little awkward. I haven't gotten used to thinking in terms of inmutable objects yet and this list appending is really a pretty bad hack to kind of allow me to increment the bin counts. How would one do this

[Haskell-cafe] xml conduit

2013-02-08 Thread grant
Hi, Is there a nice way to update xml. I want to be able to use xml-conduit to find a location in the xml and then add/update that node. eg xpath from //d/e/f and then change the content at 'f' or add a new node a ... d e fsome data to change /f /e /d ... /a Thanks

Re: [Haskell-cafe] performance question

2013-02-08 Thread Branimir Maksimovic
Heh, I have wrote c++ version and that is much faster than python ;) bmaxa@maxa:~/haskell$ time ./createMatrixDump.py -N 128 output.txt real0m0.041suser0m0.040ssys 0m0.000sbmaxa@maxa:~/haskell$ time ./printMatrixDecay.py - output.txt(-) read 16384 matrix elements (128x128 =

Re: [Haskell-cafe] xml conduit

2013-02-08 Thread Mateusz Kowalczyk
I don't know about xml-conduit but I know that such thing is possible in HXT. See the `Modifying a Node' section at [1] for a trivial example. You probably will have to read the whole page to somewhat understand what's going on though. [1] -

[Haskell-cafe] CoArbitrary

2013-02-08 Thread Tony Morris
Hello, In the QuickCheck library, there is a type-class called CoArbitrary. It is defined like so: class CoArbitrary a where coarbitrary :: a - Gen b - Gen b -- Gen is a monad Its purpose is to allow generation of functions. In other words, for taking Gen x - Gen (a - x), which could be done