Re: [Haskell-cafe] ANN: Robot - Simulate keyboard and mouse events under X11

2013-05-09 Thread Tobias Dammers
On Thu, May 09, 2013 at 01:36:52PM +1200, Chris Wong wrote: > > On Tue, May 7, 2013 at 5:18 AM, Jeanne-Kamikaze > wrote: > > Looks like an interesting library. Will it be able to read pixels from a > > window at some point? > > Not sure -- I have no idea how screen capturing works in X11. Callin

Re: [Haskell-cafe] What symbol / atom/ interned-string package is currently preferred?

2013-05-09 Thread Johannes Waldmann
> http://hackage.haskell.org/package/intern what does this package do? OK, I can read "efficient hash consing" but what does it mean exactly? and how would I actually use it? - J.W. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.

Re: [Haskell-cafe] What symbol / atom/ interned-string package is currently preferred?

2013-05-09 Thread Oliver Charles
On 05/09/2013 12:56 PM, Johannes Waldmann wrote: http://hackage.haskell.org/package/intern what does this package do? OK, I can read "efficient hash consing" but what does it mean exactly? and how would I actually use it? I can't tell you what it does, but there is an example - https://github.c

Re: [Haskell-cafe] What symbol / atom/ interned-string package is currently preferred?

2013-05-09 Thread Johannes Waldmann
> https://github.com/ekmett/intern/blob/master/examples/Term.hs sure I found this but that still does not say much. I known generally what "hash consing" is (and that's why I think I might want to use this package) but I don't see what is the (implied) contract for this implementation: It looks

[Haskell-cafe] Error compiling transformers-base-0.4.1 (debian 64 bits, ghc-7.4.2)

2013-05-09 Thread jean-christophe mincke
Hello Café I am running into problems when installing transformers-base-0.4.1. Has anyone an idea about what is going on? REM : this is a "brand new" debian install, I have just install ghc, cabal install cabal-install etc. Thank you very much J-C cabal install transformers-base Resolving d

Re: [Haskell-cafe] ghci: Difference in garbage collection etc. between REPL and function

2013-05-09 Thread Brandon Allbery
On Wed, May 8, 2013 at 9:54 PM, Niklas Hambüchen wrote: > If I run these steps one by one in ghci, garbage ends up in my handle as > expected. > > However, if I "let main = do ..." this whole block in order to pack it > in a test case, it does not happen, neither in ghci nor ghc. > ghci is in ma

Re: [Haskell-cafe] Constrained Category, Arrow, ArrowChoice, etc?

2013-05-09 Thread Sjoerd Visscher
Hi Conal, I have a package data-category that should be able to do this. http://hackage.haskell.org/package/data-category I tried implementing your linear map, and this is the result: https://gist.github.com/sjoerdvisscher/5547235 I had to make some changes to your linear map data type, because

Re: [Haskell-cafe] Error compiling transformers-base-0.4.1 (debian 64 bits, ghc-7.4.2)

2013-05-09 Thread Sjoerd Visscher
There's a flag to turn it off, does that work? Try cabal install transformers-base -f-OrphanInstances Sjoerd On May 9, 2013, at 2:47 PM, jean-christophe mincke wrote: > Hello Café > > I am running into problems when installing transformers-base-0.4.1. > > Has anyone an idea about what is g

Re: [Haskell-cafe] ghci: Difference in garbage collection etc. between REPL and function

2013-05-09 Thread Niklas Hambüchen
On 09/05/13 20:50, Brandon Allbery wrote: > ghci is in many ways like an endless (or at least until ":l"/":r") > do-block. In particular, the handle remains in scope after you run your > commands at the prompt, so it is not garbage collected. If you enclose > it into its own do block, this introdu

Re: [Haskell-cafe] ghci: Difference in garbage collection etc. between REPL and function

2013-05-09 Thread Brandon Allbery
On Thu, May 9, 2013 at 10:19 AM, Niklas Hambüchen wrote: > On 09/05/13 20:50, Brandon Allbery wrote: > > ghci is in many ways like an endless (or at least until ":l"/":r") > > do-block. In particular, the handle remains in scope after you run your > > commands at the prompt, so it is not garbage

Re: [Haskell-cafe] What symbol / atom/ interned-string package is currently preferred?

2013-05-09 Thread Andrew Cowie
On Thu, 2013-05-09 at 11:56 +, Johannes Waldmann wrote: > > http://hackage.haskell.org/package/intern > > what does this package do? OK, I can read "efficient hash consing" > but what does it mean exactly? and how would I actually use it? Hah. I read the same thing and came to exactly the s

[Haskell-cafe] Interfacing Java/Haskell

2013-05-09 Thread Hans Georg Schaathun
Hi all, I am rather new to the café, so I just hope my question fits in. Does anyone have experience with integrating Haskell and Java? I have done some searching, finding a lot of pointers but hardly anything in terms of evaluation, successes, or caveats. >From what I see Frege looks promisin

Re: [Haskell-cafe] Interfacing Java/Haskell

2013-05-09 Thread Dan Mead
(oops, forgot to reply all) if you're on the jvm already why not consider clojure? it lacks static typing, but S expressions can stand in for haskell types if you really need them to. otherwise you'll have to do some fancy JNI calls and worry about calling haskell from C, like this http://www.

Re: [Haskell-cafe] Interfacing Java/Haskell

2013-05-09 Thread harry
Hans Georg Schaathun schaathun.net> writes: > Does anyone have experience with integrating Haskell and Java? > I have done some searching, finding a lot of pointers but hardly > anything in terms of evaluation, successes, or caveats. > > From what I see Frege looks promising, arguably not hask

Re: [Haskell-cafe] Interfacing Java/Haskell

2013-05-09 Thread Hans Georg Schaathun
On Thu, May 09, 2013 at 11:29:19AM -0400, Dan Mead wrote: > if you're on the jvm already why not consider clojure? This is why (from the clojure site you referenced): «Clojure is impure, in that it doesn't force your program to be referentially transparent, and doesn't strive for 'provable' progra

Re: [Haskell-cafe] Accessing resource files in tests

2013-05-09 Thread Sturdy, Ian
If you are running the tests from cabal, they will always be started in the directory with the .cabal file, and relative paths from there are fine. If that is not the case, could you provide more details about how you are running the test? Ian R. Sturdy From: ha

[Haskell-cafe] Fwd: Error compiling transformers-base-0.4.1 (debian 64 bits, ghc-7.4.2)

2013-05-09 Thread jean-christophe mincke
Thank you Sjoerd, Unfortunately this does not work. I think the problem is linked to the evaluation of the condition (in Base.hs) #if !MIN_VERSION_base(4,4,0) && HS_TRANSFORMERS_BASE__ORPHANS Just as a test, I modified the file and added the following lines A. negation of min_version #if *!*MI

[Haskell-cafe] Stream instance for Parsec + conduits

2013-05-09 Thread Phil Scott
Hi all. I would like to have a Parsec Stream instance for Data.Text streams in yesod's ConduitM. So far, I have this: hpaste.org/87599 The idea is that because Yesod's conduits will be chunking values in Data.Text, I should have a wrapper StreamSource to cache chunked values. For some reason,

Re: [Haskell-cafe] Interfacing Java/Haskell

2013-05-09 Thread Dominic Espinosa
Hello, I've had some success with the Thrift library (http://thrift.apache.org/). See this blog post (http://mortenib.wordpress.com/2009/10/29/thrift-and-haskell/) for a basic tutorial on getting started. My project was interfacing a haskell library of machine learning algorithms (which I wrote) w

[Haskell-cafe] Fwd: Error compiling transformers-base-0.4.1 (debian 64 bits, ghc-7.4.2)

2013-05-09 Thread jean-christophe mincke
Hello again, After some more investigation, it seems that conditional compilation does not work properly. All pragmas such as #if some-cabal-defined-macro (...) always evaluate to true. I made sure to have cpphs installed but that did not solve my problem. Any idea? Thank you Regards J-C

Re: [Haskell-cafe] Constrained Category, Arrow, ArrowChoice, etc?

2013-05-09 Thread Conal Elliott
Hi Sjoerd, Thanks very much for the help sorting out options for more flexibility in Category instances. I like how you spotted and removed the id problem. I’ve cloned your gist and tried out an idea to simplify verifying the required constraints on linear

Re: [Haskell-cafe] Constrained Category, Arrow, ArrowChoice, etc?

2013-05-09 Thread Sjoerd Visscher
Hi Conal, > I’ve cloned your gist and tried out an idea to simplify verifying the > required constraints on linear map values. > Lovely use of view patterns! It looks like it is not necessary to store the LM value, all that is needed is to store that VS2 s a b is satisfied. > Am I right in think

[Haskell-cafe] Flip around type parameters?

2013-05-09 Thread Christopher Howard
Hi. Does Haskell allow you to flip around type parameters somehow? I was playing around with toy code (still learning the fundamentals) and I came up with a class like this: code: class Rotatable2D a where rotate :: (Num b) => (a b) -> b -> (a b) It was easy to make an inst

Re: [Haskell-cafe] Flip around type parameters?

2013-05-09 Thread kudah
No. You'll have to use a newtype. Type parameter order is a huge deal for some types, e.g. monad transformers, you'd better think about it beforehand. On Thu, 09 May 2013 19:39:12 -0800 Christopher Howard wrote: > Hi. Does Haskell allow you to flip around type parameters somehow? I > was playing

[Haskell-cafe] Reinventing a solution to configuration problem

2013-05-09 Thread Krzysztof Skrzętnicki
Hello Cafe, I came up with (actually reinvented [1]) a solution to configuration problem. For example configuration: data Config = Config { port :: Int, verbosity :: Int, logfile :: FilePath } deriving Show the basic idea is to use implicit parameters: runServer :: (?config :: Config) => IO ()