Re: [Haskell-cafe] more gtk help

2013-08-13 Thread briand
On Mon, 12 Aug 2013 14:50:43 +0100 Claude Heiland-Allen cla...@mathr.co.uk wrote: Hi Brian, On 12/08/13 03:52, bri...@aracnet.com wrote: ... Couldn't match expected type ... Gtk.on Gtk.exposeEvent glCanvas $ \ _ - putStrLn foo ... I looked up the type of Gtk.on and

[Haskell-cafe] more gtk help

2013-08-11 Thread briand
after getting the entry widget events to work as i wanted, i started looking at some other things to do, and my first attempt failed with this : Couldn't match expected type `Gtk.Signal (Gtk.Signal self0 (Gtk.EventM Gtk.EExpose Bool)) (t0 - IO ())'

Re: [Haskell-cafe] haskell-gtk entry question

2013-07-27 Thread briand
On Sat, 27 Jul 2013 15:44:44 +0100 Claude Heiland-Allen cla...@mathr.co.uk wrote: Perhaps it's a terminology confusion: in GTK, activate for an entry means pressing return key. This program works fine for me, pressing return prints the text I entered in the box: 8 import

[Haskell-cafe] haskell-gtk entry question

2013-07-24 Thread briand
Hello all, This should be simple, and I thought it had it working, but I've broken it and can't figure out why. What I want is to invoke the callback whenever the user activates and entry in a dialogbox, so I did both this : Gtk.on entry Gtk.entryActivate (boxHandler entry) (I believe this

[Haskell-cafe] opengl type confusion

2013-06-16 Thread briand
This, wireframe :: Double - Double - Double - IO () wireframe wx wy wz = do -- yz plane renderPrimitive LineLoop $ do vertex $ Vertex3 0.0 0.0 0.0 vertex $ Vertex3 0.0 wy 0.0 vertex $ Vertex3 0.0 wy wz

Re: [Haskell-cafe] opengl type confusion

2013-06-16 Thread briand
On Sun, 16 Jun 2013 16:15:25 -0400 Brandon Allbery allber...@gmail.com wrote: On Sun, Jun 16, 2013 at 4:03 PM, bri...@aracnet.com wrote: Changing the declaration to GLdouble - GLdouble - GLdouble - IO() and using (0.0::GLdouble) fixes it, and I'm not clear on why it's not automagic.

Re: [Haskell-cafe] opengl type confusion

2013-06-16 Thread briand
On Sun, 16 Jun 2013 22:19:22 +0100 Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: On Sun, Jun 16, 2013 at 01:03:48PM -0700, bri...@aracnet.com wrote: wireframe :: Double - Double - Double - IO () wireframe wx wy wz = do -- yz plane renderPrimitive LineLoop $ do

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-03 Thread briand
On Mon, 03 Jun 2013 19:16:08 + silvio silvio.fris...@gmail.com wrote: Hi everyone, Every time I want to use an array in Haskell, I find myself having to look up in the doc how they are used, which exactly are the modules I have to import ... and I am a bit tired of staring at type

Re: [Haskell-cafe] Array, Vector, Bytestring

2013-06-03 Thread briand
On Mon, 3 Jun 2013 23:19:38 -0400 Clark Gaebel cgae...@uwaterloo.ca wrote: That's absolutely true. Wrappers around vector for your multidimensional access is probably best, but Vectors of Vectors are usually easier. But again, you're right. Multidimensional access is a pain. If it's a

Re: [Haskell-cafe] Concurrency performance problem

2013-03-04 Thread briand
On Mon, 4 Mar 2013 20:39:43 +0100 Łukasz Dąbek sznu...@gmail.com wrote: Thank you for your help! This solved my performance problem :) do you have a link to the new code ? it should be very instructive to see the differences. Brian ___

Re: [Haskell-cafe] Trouble installing and using Chart/cairo on windows 7

2013-03-03 Thread briand
On Sun, 3 Mar 2013 19:58:37 -0500 Brent Yorgey byor...@seas.upenn.edu wrote: Good access to fonts and font metrics is the kicker. Otherwise I'd say to switch to using diagrams as a backend, hence getting a whole bunch of actual backends for free. I would love to see development of some

[Haskell-cafe] ~ operator ?

2013-02-18 Thread briand
Hi all, I was creating bigger uncurries which I am simply extending from an existing uncurry I found some where, e.g. uncurry4 :: (a - b - c - d - e) - ((a, b, c, d) - e) uncurry4 f ~(a,b,c,d) = f a b c d when I realized, what's the ~ for ? I've only been able to find a partial explanation

Re: [Haskell-cafe] ~ operator ?

2013-02-18 Thread briand
On Mon, 18 Feb 2013 19:13:13 + Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk wrote: On 18/02/13 19:02, bri...@aracnet.com wrote: Hi all, I was creating bigger uncurries which I am simply extending from an existing uncurry I found some where, e.g. uncurry4 :: (a - b - c - d - e) -

Re: [Haskell-cafe] performance question

2013-02-12 Thread briand
On Tue, 12 Feb 2013 15:57:37 -0700 Nicolas Bock nicolasb...@gmail.com wrote: Here is haskell version that is faster than python, almost as fast as c++. You need to install bytestring-lexing package for readDouble. I was hoping Branimir could comment on how the improvements were allocated.

[Haskell-cafe] hxt pickling question

2013-01-24 Thread briand
Hi, Trying to understand how to write a document using a pickler but I can't make sense of the types. From the example: runX ( xunpickleDocument xpSeason [ withValidate no , withTrace 1 ,

Re: [Haskell-cafe] hxt pickling question

2013-01-24 Thread briand
On Thu, 24 Jan 2013 17:05:15 +0100 Erik Hesselink hessel...@gmail.com wrote: There's showPickled [0] and unpickleDoc [1], maybe those help? Thank you , they help a lot :-) I was stuck looking in Text.XML.HXT.Arrow.Pickle for the answer and got lost trying to decipher IOStateArrow s a

Re: [Haskell] ANN: Portackage - a hackage portal

2012-04-26 Thread briand
On Thu, 26 Apr 2012 23:52:47 -0400 Andrew Seniuk ras...@gmail.com wrote: Somewhat lighter, using summarised module lists. A more sophistocated UI with per-column filtering is in the works. I invite your comments. Andrew On Thu, Apr 26, 2012 at 4:05 PM, Andrew Seniuk ras...@gmail.com

[Haskell] cabal-install and ghc compatibility

2012-03-24 Thread briand
Hello, I've got ghc 7.2.2 installed. trying to install cabal-install-0.10.2 results in: Linking Setup ... Configuring Cabal-1.10.1.0... Setup: At least the following dependencies are missing: base =4 3 =2 5, unix =2.0 2.5 Error during cabal-install bootstrap: Configuring the Cabal package

Re: [Haskell-cafe] Memoization of functions

2011-09-06 Thread briand
On Tue, 06 Sep 2011 15:16:09 -0400 Michael Orlitzky mich...@orlitzky.com wrote: I'm working on a program where I need to compute a gajillion (171442176) polynomials and evaluate them more than once. This is the definition of the polynomial, and it is expensive to compute: polynomial ::

Re: [Haskell-cafe] Data.Time

2011-06-27 Thread briand
On Mon, 27 Jun 2011 11:15:28 +0300 Yitzchak Gale g...@sefer.org wrote: The biggest shortcoming, in my opinion, is that the documentation assumes that the reader is very familiar with the Haskell type system, and with viewing type signatures and instance lists as an integral and central part

[Haskell-cafe] location of IEEE Viz code ?

2011-06-12 Thread briand
Hi, I hate to even ask this because the answer is probably staring me in the face. This trac page http://hackage.haskell.org/trac/PolyFunViz/wiki/IEEEVisCode talks about the code being available through darcs but I can't seem to put my hands on the http address I would need to pull the code.

Re: [Haskell-cafe] location of IEEE Viz code ?

2011-06-12 Thread briand
On Sun, 12 Jun 2011 21:25:22 +0100 Malcolm Wallace malcolm.wall...@me.com wrote: http://hackage.haskell.org/trac/PolyFunViz/wiki/IEEEVisCode talks about the code being available through darcs but I can't seem to put my hands on the http address I would need to pull the code. This

Re: [Haskell-cafe] How do you test a parser?

2011-06-11 Thread briand
On Sat, 11 Jun 2011 10:34:47 -0700 Alexander Solla alex.so...@gmail.com wrote: On Sat, Jun 11, 2011 at 10:06 AM, Sean Perry sha...@speakeasy.net wrote: Choices, choices. The first one is to use unit tests. Look at the grammar and make sure the obvious stuff fails or succeeds. a + b, a

[Haskell-cafe] best way to use ghc-7.0 under debian stable

2011-06-09 Thread briand
Hi All, Currently debian stable installs ghc 6.12.1. I'd like to use the latest version of repa which is built on ghc 7.0, and my attempts to placate cabal's complaints about the installation of various packages isn't going anywhere. It's not obvious to me that there's an advantage to using

Re: [Haskell-cafe] Accelerate package (CUDA). How to actually create an array?

2011-05-17 Thread briand
On Mon, 16 May 2011 20:33:12 +0400 Grigory Sarnitskiy sargrig...@ya.ru wrote: Hello! I'm probing CUDA with Haskell, accelerate package to be exact. Sound stupid, but I couldn't find how to actually construct an array, for example Vector Float. There is quite a number of examples

[Haskell-cafe] why doesn't ghc give you a type signature that works ?

2011-05-17 Thread briand
for example: I will ask the glorious compiler, and it says: *Main :t calcFFT calcFFT :: (Math.FFT.Base.FFTWReal r) = V.Vector (Complex r) - V.Vector (Complex r) I then put the signature in my code, reload it, and: Not in scope: type constructor or class `Math.FFT.Base.FFTWReal' It

[Haskell-cafe] repa Shape help

2011-05-08 Thread briand
Howdy, as usual, the haskell type system complete defeats me in the simplest of applications: import Data.Array.Repa as A import Data.Array.Repa.Index import Data.Array.Repa.Shape as AS main = do let x = A.fromList (AS.shapeOfList [2, 2]) ([1.0, 2.0, 3.0, 4.0]::[Double]) putStrLn $ show x

Re: [Haskell-cafe] ANN: Newt - command-line template instantiation tool library

2011-05-08 Thread briand
On Sun, 8 May 2011 16:23:59 -0700 Rogan Creswick cresw...@gmail.com wrote: Newt scans the input (either a file, directory or stdin) for tags marked with tagName [1], then replaces those entries with values specified on the command line, producing either a new file, modifying the input

Re: [Haskell-cafe] writing to a fifo when the reader stops reading

2011-03-14 Thread briand
On Mon, 14 Mar 2011 02:33:13 -0400 Brandon S Allbery KF8NH allber...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 3/13/11 03:16 , bri...@aracnet.com wrote: ghc: fdWriteBuf: resource vanished (Broken pipe) which make sense, sort of. I write a value, let's say 10,

[Haskell-cafe] writing to a fifo when the reader stops reading

2011-03-12 Thread briand
Hi all, here's the code: writer = do threadDelay 10 threadWaitWrite fd fdWrite fd ((show x) ++ \n) writer fd (x+1) pretty simple, it just keeps writing. What happens though is that, eventually, the reader goes away, i.e. closes the fifo. When that happens I get: ghc:

Re: [Haskell-cafe] [SOLVED] why is ghci trying to load hsc file ??

2011-02-28 Thread briand
On Mon, 28 Feb 2011 02:58:58 + Felipe Almeida Lessa felipe.le...@gmail.com wrote: On Sun, Feb 27, 2011 at 6:48 AM, by way of bri...@aracnet.com bri...@aracnet.com wrote: the binding-DSL examples do NOT use the above PRAGMA anywhere in the code. Probably they have Extensions:

Re: [Haskell-cafe] [SOLVED] why is ghci trying to load hsc file ??

2011-02-27 Thread briand
On Sat, 26 Feb 2011 22:42:15 -0700 Chris Smith cdsm...@gmail.com wrote: On Sat, 2011-02-26 at 21:36 -0800, bri...@aracnet.com wrote: [1 of 2] Compiling Bindings.HDF5( dist/build/Bindings/HDF5.hs, interpreted ) *** Parser: src/Bindings/HDF5.hsc:49:8: parse error on input `import'

[Haskell-cafe] why is ghci trying to load hsc file ??

2011-02-26 Thread briand
Howdy, I worked out a small hdf5 binding using cabal and bindings-DSL and sqlite3 as my example. Time to try it ! ghci -idist/build/ dist/build/Bindings/HDF5.o -lhdf5 -lhdf5_hl hdf5_pkg_test.hs GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking

Re: [Haskell-cafe] why is ghci trying to load hsc file ??

2011-02-26 Thread briand
On Sat, 26 Feb 2011 18:18:27 -0800 (PST) Brandon Moore brandon_m_mo...@yahoo.com wrote: I assume there's a LINE directive in the file it's actually reading. Run ghci with -v to see what file it's actually trying to read. Here's the relevant output with -v flag: compile: input

[Haskell-cafe] best way to deal with #defines when developing ffi's

2011-02-22 Thread briand
Hi all, I'm working on an FFI and as usual there are lots of defines in the header files. What's the best way to make these available to the haskell code ? Ideally it could be done automagically, or at least pseudo-magically so that keeping up with changes to the .h wouldn't be too painful. I'm

[Haskell-cafe] command line options using ghc -e

2010-12-26 Thread briand
Hi, for example : ghc -e main foo.hs these should be treated as args for argv I'm wondering if there is a magic option to indicate that everything after this option is an arg option. Thanks Brian P.S. yes I know about :main args in ghci. ___

[Haskell-cafe] global, modifiable variable for debugging

2010-12-26 Thread briand
Hi, I have a program with a debug flag in it (Strangely I've yet to be able to write bug-free code). I'd like to change the state of the debug flag based on command line args. I looked at IOVar but that would cause all the pure procedures to get swallowed by the IO Monad. Is a better way to

[Haskell-cafe] searching haskell-cafe ?

2010-09-19 Thread briand
is there a way to search the haskell-cafe list. I found a potential link on the haskell wiki, but the link is busted. Didn't see anything on the haskell-cafe mailing list page. Thanks, Brian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] cairo rendered to screen examples

2010-08-08 Thread briand
I've been running around the gtk2hs web site and can't seem to find the actual code (I did find the cairo blog, with examples but no code). Can some kind soul post a link ? Thanks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] cairo rendered to screen examples

2010-08-08 Thread briand
On Sun, 8 Aug 2010 11:13:33 -0700 bri...@aracnet.com wrote: I've been running around the gtk2hs web site and can't seem to find the actual code (I did find the cairo blog, with examples but no code). Can some kind soul post a link ? and here you go:

[Haskell-cafe] gkt2hs seg fault issue

2010-08-08 Thread briand
I reported a seg-fault in chart a while back. so I was experimenting with cairo and rendering to to the screen, which if my understanding is correct, uses gtk. Certainly looks like it. So I compiled the cairo example Drawing.hs and that worked fine. I then tried running the example from ghci,

Re: [Haskell-cafe] Re: gkt2hs seg fault issue

2010-08-08 Thread briand
On Mon, 09 Aug 2010 11:09:40 +0800 Andy Stewart lazycat.mana...@gmail.com wrote: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes: On 9 August 2010 09:44, Andy Stewart lazycat.mana...@gmail.com wrote: Which ghc version? The Glorious Glasgow Haskell Compilation System, version

Re: [Haskell-cafe] Re: Haskell in Industry

2010-08-06 Thread briand
On Thu, 5 Aug 2010 21:58:15 -0500 Tom Hawkins tomahawk...@gmail.com wrote: Good, we need more functional programmers actually solving real problems. But please put your skills to work in an industry other than investment banking. +1000 ___

Re: [Haskell-cafe] Chart package segfaults when rendering to window

2010-07-27 Thread briand
On Mon, 26 Jul 2010 21:54:16 -0700 Thomas DuBuisson thomas.dubuis...@gmail.com wrote: Can you boil this down to some simple example code? Are you using a recent version of Chart? And your definition of latest gtk2hs is 11, right? How about your gtk+ C library, it what? 2.20? I can run

[Haskell-cafe] Chart package segfaults when rendering to window

2010-07-26 Thread briand
Seems to be ok rendering to png files. I was wondering if anybody has been using Chart and may have seen the same thing. I'm running ghc 6.12.1 and the latest and greatest gtk2hs :-) Thanks, Brian p.s. the amplitude modulation ___ Haskell-Cafe

Re: [Haskell-cafe] RE: Design for 2010.2.x series Haskell Platform site (Don Stewart)

2010-07-17 Thread briand
On Sat, 17 Jul 2010 18:02:05 -0400 Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/17/10 13:23 , Christopher Done wrote: On 17 July 2010 18:18, Niemeijer, R.A. r.a.niemei...@tue.nl wrote: Screenshot: http://imgur.com/9LHvk.jpg Live

Re: [Haskell-cafe] Re: Please report any bug of gtk2hs-0.11.0!

2010-07-14 Thread briand
On Wed, 14 Jul 2010 21:05:35 +0800 Andy Stewart lazycat.mana...@gmail.com wrote: Where's the demo directory ?! Sorry, we forgot add demo in .cabal file when we released gtk2hs-0.11.0, We will include all demos in gtk2hs-0.11.1 I think that would be very helpful. It's a big package with

Re: [Haskell-cafe] Re: Please report any bug of gtk2hs-0.11.0!

2010-07-13 Thread briand
Short version of this post: Looks like the intsall depends on alex and that dependencies doesn't appear to be handled, i.e. I had to install alex before proceeding. why do is it called gtk2hs if you are actually installing package gtk ;-) Where's the demo directory ?! Moral of the story: don't

Re: [Haskell-cafe] mixing map and mapM ?

2010-05-06 Thread briand
On Thu, 06 May 2010 12:00:01 +0100 Neil Brown nc...@kent.ac.uk wrote: At which point I prefer Ivan's liftM version rather than the above section (or worse: using ($) prefix). The original request is a relatively common thing to want to do, so I was slightly surprised that hoogling for:

[Haskell-cafe] mixing map and mapM ?

2010-05-05 Thread briand
I was doing the following: do status - mapM PF.getFileStatus filenames let times = map PF.modificationTime status let sorted = sortBy (\(_, t1) (_,t2) - compare t1 t2) (zip filenames times) and I thought, surely I can combine the status and times definitions into one line, only I can't.

Re: [Haskell-cafe] mixing map and mapM ?

2010-05-05 Thread briand
On Thu, 6 May 2010 15:07:30 +1000 Ivan Miljenovic ivan.miljeno...@gmail.com wrote: On 6 May 2010 15:01, bri...@aracnet.com wrote: I was doing the following: do status - mapM PF.getFileStatus filenames   let times = map PF.modificationTime status   let sorted = sortBy (\(_, t1)

Re: [Haskell-cafe] Intro to Haskell Crypto Libs

2010-04-01 Thread briand
On Thu, 01 Apr 2010 14:14:42 +0200 Günther Schmidt gue.schm...@web.de wrote: Hi all, I'm just starting with Haskells Crypto Libs. Is there a good intro to the subject? I intend to use it for license key generation. Applied Cryptography http://www.schneier.com/book-applied.html Brian

Re: [Haskell-cafe] why doesn't time allow diff of localtimes ?

2010-03-31 Thread briand
On Wed, 31 Mar 2010 01:32:56 -0400 wagne...@seas.upenn.edu wrote: Two values of LocalTime may well be computed with respect to different timezones, which makes the operation you ask for dangerous. First convert to UTCTime (with localTimeToUTC), then compare. that makes sense. unfortunately

Re: [Haskell-cafe] Re: why doesn't time allow diff of localtimes ?

2010-03-31 Thread briand
On Thu, 01 Apr 2010 06:20:25 +0200 Maciej Piechotka uzytkown...@gmail.com wrote: On Wed, 2010-03-31 at 19:29 -0700, bri...@aracnet.com wrote: On Wed, 31 Mar 2010 01:32:56 -0400 wagne...@seas.upenn.edu wrote: Two values of LocalTime may well be computed with respect to different

[Haskell-cafe] why doesn't time allow diff of localtimes ?

2010-03-30 Thread briand
which is a variation of the question, why can't I compare localtimes ? or am I missing something in Time (yet again). Thanks, Brian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Category Theory woes

2010-02-06 Thread briand
On Sun, 07 Feb 2010 01:38:08 +0900 Benjamin L. Russell dekudekup...@yahoo.com wrote: On Tue, 02 Feb 2010 09:16:03 -0800, Creighton Hogg wrote: 2010/2/2 Álvaro García Pérez agar...@babel.ls.fi.upm.es You may try Pierce's Basic Category Theory for Computer Scientists or Awodey's