[Haskell-cafe] HAPPS on a major hosting provider?

2008-11-16 Thread Jefferson Heard
I was wondering if anyone's ever tried to run Haaps on a major hosting provider, like oh, say Site5? I have an app I'd otherwise use Rails for and I thought I'd give Haaps a try... -- Jeff I try to take things like a crow; war and chaos don't always ruin a picnic, they just mean you have to be

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-11 Thread Jefferson Heard
Kyle, I would say that most apps don't actually require that you write a mutation heavy inner loop. They can be written either way, and Haskell gives you the facility to do both. Even my field, which is visualization can be written either way. I write with a mutation heavy inner loop myself, bec

Re: [Haskell-cafe] Re: What *not* to use Haskell for

2008-11-11 Thread Jefferson Heard
Actually, one language you mention there *is* worse than the others for writing wrappable library code: C++. Admittedly, they've got a Python interface now via boost, but the main problem with writing wrappable C++ code is the template system and the inheritence systems getting in the way. Symbol

Re: [Gtk2hs-users] [Haskell-cafe] Anyone know why this always returns invalid texture objects?

2008-11-06 Thread Jefferson Heard
ithGLDrawingArea $ glGenObjects n ? Thanks! -- Jeff On Thu, Nov 6, 2008 at 9:15 PM, Bertram Felgenhauer <[EMAIL PROTECTED]> wrote: > [CCing gtk2hs-users] > > Jefferson Heard wrote: >> import Graphics.UI.Gtk >> import Graphics.UI.Gtk.Glade >> import Graphics.UI.Gtk.Ope

[Haskell-cafe] Anyone know why this always returns invalid texture objects?

2008-11-06 Thread Jefferson Heard
import Graphics.UI.Gtk import Graphics.UI.Gtk.Glade import Graphics.UI.Gtk.OpenGL import qualified Graphics.Rendering.OpenGL as GL import Graphics.Rendering.OpenGL (($=)) main = do initGUI initGL GL.shadeModel $= GL.Flat GL.depthFunc $= Just GL.Less (window1,gui,dlgs) <- constructGUIObje

[Haskell-cafe] HOpenGL wiki link to documentation is broken

2008-11-05 Thread Jefferson Heard
I suspect this has to do with the latest GHC not including it by default, but the HOpenGL wiki's documentation links are broken. -- Jeff ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Cairo build fail on OS X Leapord

2008-11-03 Thread Jefferson Heard
how can we use those from MacPorts? Is it possible? On Mon, Nov 3, 2008 at 5:59 AM, Duncan Coutts <[EMAIL PROTECTED]> wrote: > On Fri, 2008-10-31 at 14:55 -0400, Jefferson Heard wrote: >> Installing gtk2hs from MacPorts on a clean mac: > >> svgcairo/Graphics/Rende

[Haskell-cafe] Cairo build fail on OS X Leapord

2008-10-31 Thread Jefferson Heard
Installing gtk2hs from MacPorts on a clean mac: 2 -I/usr/X11R6/include svgcairo/Graphics/Rendering/Cairo/SVG.chs:201:2: Couldn't match expected type `()' against inferred type `CInt' Expected type: Render () Inferred type: Render CInt In the expression: liftIO

Re: [Haskell-cafe] Re: ghc-6.11 + OpenGL/GLUT crashes on WinXP

2008-10-29 Thread Jefferson Heard
). > > Mark > > > Conal Elliott wrote: >> >> No display lists. The crash happens during the GLUT call "initialize". I >> can trigger it from ghci with the following simple incantation: >> >> Prelude> import Graphics.UI.GLUT >>

Re: [Haskell-cafe] Re: ghc-6.11 + OpenGL/GLUT crashes on WinXP

2008-10-28 Thread Jefferson Heard
Conal, are you using display lists at all? I've had problems with allocating lists, but you seem to be able to leave off the allocation step in Windows on nVidia cards so long as you're careful not to conflict names yourself. On Tue, Oct 28, 2008 at 4:03 PM, Matti Niemenmaa <[EMAIL PROTECTED]> wr

Re: [Haskell-cafe] Memory efficiency questions for real-time graphics

2008-10-27 Thread Jefferson Heard
By the way, T, feel free to lean on me if you run into any problems. I did something along the lines of what you were describing some time ago, my particular non-linear transform being converting a vertex array to/from polar coordinates and updating in realtime. -- Jeff On Tue, Oct 28, 2008 at 12

Re: [Haskell-cafe] How to deal with pointers to pointers in the FFI

2008-10-17 Thread Jefferson Heard
Sadly, nothing so awesome... OGR is part of GDAL, an open-source geographic information system suite. On Fri, Oct 17, 2008 at 3:22 PM, Jake McArthur <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jefferson Heard wrote: >> I have the

[Haskell-cafe] How to deal with pointers to pointers in the FFI

2008-10-17 Thread Jefferson Heard
I have the following functions in C: OGRErr OGR_G_CreateFromWkb (unsigned char *, OGRSpatialReferenceH, OGRGeometryH *, int) OGRErr OGR_G_CreateFromWkt (char **, OGRSpatialReferenceH, OGRGeometryH *) voidOGR_G_DestroyGeometry (OGRGeometryH) OGRGeometryHOGR_G_CreateGeometry (OGRwkbGeometr

[Haskell-cafe] Cairo and dialog oddities on Windows using glade.

2008-10-15 Thread Jefferson Heard
Maybe I'm doing something wrong. I've created several dialog boxes in Glade, and I'm calling Gtk.runDialog on them when a user clicks the mouse in my main window. On Linux, they work mostly right, but the insertion point never shows in the Gtk.Entry areas and the dialog itself comes up without an

Re: [Haskell-cafe] Drawing an existing image into a cairo surface?

2008-09-21 Thread Jefferson Heard
Sorry. In a hurry, and I don't have a lot of time to read the message, so if I'm offering a lot of info you already have, I apologize. The best thing to do is to allocate either a pixmap or Gtk.DrawingArea -- you can then use widgetGetDrawable to get the drawing context from it and newGC to take

Re: [Haskell-cafe] Python's big challenges, Haskell's big advantages?

2008-09-17 Thread Jefferson Heard
Both Jython and JRuby can use multicore parallelism. Which, of course, you need desperately when running in Jython and JRuby, because they're slow as christmas for most tasks. In addition, Jython is not a predictably complete version of Python and its internals are not well documented in the leas

Re: [Haskell-cafe] Python's big challenges, Haskell's big advantages?

2008-09-17 Thread Jefferson Heard
Multiprocessing is hardly a solution... I realize the Python interpreter's fairly lightweight on its own, but the weight of a full unix process plus the weight of the python interpreter in terms of memory, context switching times, and finally the clunkiness of the fork() model (which is HOW many y

Re: [Haskell-cafe] monadic map on a Data.IntMap

2008-09-08 Thread Jefferson Heard
I suppose a mapM_ monadicFunction . Data.IntMap.toList $ m doesn't work for you? On Mon, Sep 8, 2008 at 2:11 PM, minh thu <[EMAIL PROTECTED]> wrote: > Hi, > > Is there something like a fmapM_ ? > In particular, I'd like to mapM_ a Data.IntMap instead of a List > > Thank you, > Thu >

Re: [Haskell-cafe] OpenGL's VBO with Haskell

2008-08-25 Thread Jefferson Heard
check your hardware if I were you. On Mon, Aug 25, 2008 at 2:35 PM, Jefferson Heard <[EMAIL PROTECTED]> wrote: > That code looks like it ought to work, and I assume if you're using > VBOs that you know how to make sure your frustum is setup so that > you're object's visible

Re: [Haskell-cafe] OpenGL's VBO with Haskell

2008-08-25 Thread Jefferson Heard
That code looks like it ought to work, and I assume if you're using VBOs that you know how to make sure your frustum is setup so that you're object's visible. Are you running this in Windows or in Linux or ? and what version of GHC are you using? There is also a specific HOpenGL mailinglist, just

Re: [Haskell-cafe] String to Double conversion in Haskell

2008-08-24 Thread Jefferson Heard
Because normally, Prelude.read covers this. Don's link is the most efficient, but you can also do (read . ByteString.unpack $ bytestring) :: Double to get a Double from a printed representation of most numbers. 2008/8/24 Daryoush Mehrtash <[EMAIL PROTECTED]>: > I am curious to understand the lo

Re: [Haskell-cafe] ANN: Tutorial on information visualization and visual analytics in Haskell

2008-08-19 Thread Jefferson Heard
The tutorial has now been updated to what I think will more or less be the final version. There are now figures where appropriate. The code has been checked, and I'm sure now that the examples work. Now that I'm done, I'll repeat the original announcement, and all can enjoy: This is the tutoria

Re: [Haskell-cafe] ANN: Tutorial on information visualization and visual analytics in Haskell

2008-08-10 Thread Jefferson Heard
On Sat, Aug 9, 2008 at 11:30 AM, Jefferson Heard > <[EMAIL PROTECTED]> wrote: >> The link is: >> >> http://bluheron.europa.renci.org/docs/BeautifulCode.pdf > > Very readable and interesting. You may want to add some pictures or > graphs if you weren't planning o

[Haskell-cafe] Re: ANN: Tutorial on information visualization and visual analytics in Haskell

2008-08-10 Thread Jefferson Heard
9, 2008 at 2:30 PM, Jefferson Heard <[EMAIL PROTECTED]> wrote: > This is the tutorial I'll be presenting at DEFUN 2008. I'll be > building a site around it until then, complete with compilable code > examples, but I thought I would let everyone get a sneak peek at the > l

[Haskell-cafe] ANN: Tutorial on information visualization and visual analytics in Haskell

2008-08-09 Thread Jefferson Heard
This is the tutorial I'll be presenting at DEFUN 2008. I'll be building a site around it until then, complete with compilable code examples, but I thought I would let everyone get a sneak peek at the long version of the tutorial before I'm done with it. The code is as yet untested, and keep in mi

Re: [Haskell-cafe] Re: [HOpenGL] ANN: FTGL 1.0. Portable truetype font rendering in OpenGL

2008-08-07 Thread Jefferson Heard
Is DeviL currently working? I don't see any Haddock documentation, and it says "build-failure ghc-6.8"... On Thu, Aug 7, 2008 at 3:49 PM, Felipe Lessa <[EMAIL PROTECTED]> wrote: > On Thu, Aug 7, 2008 at 4:43 PM, Jefferson Heard > <[EMAIL PROTECTED]> wrote: >

[Haskell-cafe] ANN: FTGL 1.0. Portable truetype font rendering in OpenGL

2008-08-07 Thread Jefferson Heard
Hi folks. I've just released some Haskell bindings to FTGL at http://hackage.haskell.org/cgi-bin/hackage-scripts/package/FTGL . FTGL is an easy to use library for portable rendering of TrueType fonts in OpenGL, with functions for creating bitmapped fonts, texture-mapped fonts, buffered fonts, poly

Re: [Haskell-cafe] Looking for a more functional way to do this

2008-08-06 Thread Jefferson Heard
> believe: > > http://www.haskell.org/all_about_monads/html/statemonad.html > > That would safe you from passing around the State > > Jefferson Heard schrieb: >> >> Working with HOpenGL and GLUT, I find myself approaching a common >> problem with a common solution

[Haskell-cafe] Looking for a more functional way to do this

2008-08-04 Thread Jefferson Heard
Working with HOpenGL and GLUT, I find myself approaching a common problem with a common solution that I don't really like all that much, as it reeks of procedural programming. Basically the problem is that of complex program state, such that when the user provides input to the program in the form

Re: [Haskell-cafe] Problem compiling a CGI script that needs to write to file during its execution

2008-07-29 Thread Jefferson Heard
gt; createPage . blah stuff you don't care about > > getAnalysisData :: CGI Visit > > Visit is a data type I've made to hold the information obtained from the page. > > Hope this helps > allan > > > Jefferson Heard wrote: >> Please ignore the ob

[Haskell-cafe] Problem compiling a CGI script that needs to write to file during its execution

2008-07-29 Thread Jefferson Heard
Please ignore the obvious security holes, as this is not a script meant for public consumption, but some internal testing and prototyping. I would like to write the result of my computation out to a file inside of cgiMain, but the type of the monad inside cgiMain is this odd CGIT IO CGIResult. I

Re: [Haskell-cafe] Fw: patch applied (ghc): Remove the OpenGL familyof libraries fromextralibs

2008-07-29 Thread Jefferson Heard
Scott, I couldn't have said it better. My impression has always been that HOpenGL looks like OpenGL would have looked like if they'd had a flexible language to work with when they desgned it. My only quibble would be with the documentation. Is there any way out there for haddock to produce a link

Re: [Haskell-cafe] Re: [HOpenGL] Fw: patch applied (ghc): Remove the OpenGL family of libraries fromextralibs

2008-07-28 Thread Jefferson Heard
p to date. I'll set that up in the next month or so. > > Jeff, please point me to your bug. I'd like to take a look. > > --Lane > > On Fri, 25 Jul 2008, Jefferson Heard wrote: > >> I don't know how much I can do to keep them in sync, as I don't know >

Re: [Haskell-cafe] Fw: patch applied (ghc): Remove the OpenGL familyof libraries fromextralibs

2008-07-26 Thread Jefferson Heard
Yes, same here; don't worry, it's not going away. It would be nice to know, though, how many people are using it and what they're using it for. I'm using it for information visualization, and slowly evolving/cribbing together something like the Processing (http://www.processing.org) framework fo

Re: [Haskell-cafe] Fw: patch applied (ghc): Remove the OpenGL family of libraries fromextralibs

2008-07-25 Thread Jefferson Heard
Well, since HOpenGL seems to support practically all of OpenGL 2.1, I don't see that there's much to maintain, except compatibility with upcoming releases of GHC and possibly some optimization. Maybe I'm missing something, though. Is there a list of outstanding bugs somewhere? I personally know

[Haskell-cafe] Re: [HOpenGL] Fw: patch applied (ghc): Remove the OpenGL family of libraries fromextralibs

2008-07-25 Thread Jefferson Heard
I don't know how much I can do to keep them in sync, as I don't know anything about the HLP, however, I'm actively using OpenGL 2.1 in Haskell for research and prototyping and the inclusion of OpenGL in Haskell has been central to my case for using it in my workplace. I don't know what I can do to

Re: [Haskell-cafe] FPers in Northwest Arkansas?

2008-07-25 Thread Jefferson Heard
Dunno about that, but I'm a NW arkansas expat. 2008/7/25 Nathan Bloomfield <[EMAIL PROTECTED]>: > Greetings, Haskell-cafe. I am interested in joining or starting a functional > programming interest group in my area. Are there any haskellers in the > Northwest Arkansas region? > > Nathan Bloomfield

Re: [Haskell-cafe] [Off-topic] Loss of humour

2008-07-23 Thread Jefferson Heard
http://bash.org ? On Wed, Jul 23, 2008 at 2:45 PM, Andrew Coppin <[EMAIL PROTECTED]> wrote: > A while back I found a page somewhere containing some rather amusing IRC > quotes. Unfortunately it seems to have vanished. I can't remember where on > earth I found it, but I've scoured the Internet tryi

Re: [Haskell-cafe] Space leaks

2008-07-17 Thread Jefferson Heard
Peter, from 500 feet, we can't see much, but your strictness might actually be your problem depending on what "largish" looks like and whether you're reading your data from disc. It's entirely possible that your data structure updates or disc reads are head-strict and you're evaluating or loading

Re: [Haskell-cafe] Remote control of firefox through Haskell?

2008-07-15 Thread Jefferson Heard
Thanks, Rahul, Don. These work... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Remote control of firefox through Haskell?

2008-07-15 Thread Jefferson Heard
Is there a library out there that will allow me to remote-control the firefox or mozilla browsers, e.g. change the current page, open a new tab? -- I try to take things like a crow; war and chaos don't always ruin a picnic, they just mean you have to be careful what you swallow. -- Jessica Edwar

Re: [Haskell-cafe] Newbie: Appending arrays?

2008-07-10 Thread Jefferson Heard
Two questions. How often does the array change, and how big does it get? It may well be that you just copy it and take the hit, as that'll be cheaper (even in C, incidentally) than any other solution, if it's a short array or if the updates happen rarely. If not, try using Data.Array.Diff and re

Re: [Haskell-cafe] Error in configure script for GHC

2008-06-27 Thread Jefferson Heard
27;t get to the instructions for bootstrapping. On Fri, Jun 27, 2008 at 2:00 PM, Brandon S. Allbery KF8NH < [EMAIL PROTECTED]> wrote: > > On Jun 27, 2008, at 10:15 , Jefferson Heard wrote: > > checking for path to top of build tree... pwd: timer_create: Invalid >> argument >>

[Haskell-cafe] Error in configure script for GHC

2008-06-27 Thread Jefferson Heard
I've tried all the 6.6 and 6.8 versions, trying to compile them on a RHEL-based supercomputer, and I always see this error when I run ./configure: -bash-3.00$ ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target sy

Re: [Haskell-cafe] Re: Wrapping FTGL in FFI calls

2008-06-20 Thread Jefferson Heard
Exactly. thanks! On Fri, Jun 20, 2008 at 4:26 PM, Jules Bean <[EMAIL PROTECTED]> wrote: > Jefferson Heard wrote: > >> Oh, and I should say the function I want to implement is >> >> getFontBBox :: Font -> String -> IO [Float] >> >> I do know ho

Re: [Haskell-cafe] Re: Wrapping FTGL in FFI calls

2008-06-20 Thread Jefferson Heard
Oh, and I should say the function I want to implement is getFontBBox :: Font -> String -> IO [Float] I do know how to marhsal/unmarshal the String. Just not the CFloat array to Haskell [Float] On Fri, Jun 20, 2008 at 2:25 PM, Jefferson Heard < [EMAIL PROTECTED]> wrote: > Well,

Re: [Haskell-cafe] Re: Wrapping FTGL in FFI calls

2008-06-20 Thread Jefferson Heard
otype looks like this: foreign import ccall unsafe "ftglGetFontBBox" fgetFontBBox :: Font -> CString -> Ptr CFloat -> IO () the ptr to cfloat should be a float[4], which is modified inside the original C function. On Fri, Jun 20, 2008 at 1:16 AM, Achim Schneider <[EMAIL PROTE

[Haskell-cafe] Wrapping FTGL in FFI calls

2008-06-19 Thread Jefferson Heard
I've been looking for awhile now for a simple way to get truetype fonts into my visualizations so I can abandon the hideous GLUT fonts and make things that look like they were developed in the 1990s instead of back in the days of TRON. I found FTGL, but I'm mostly a Haskell developer these days, a

[Haskell-cafe] Wrapping FTGL in FFI calls

2008-06-19 Thread Jefferson Heard
I've been looking for awhile now for a simple way to get truetype fonts into my visualizations so I can abandon the hideous GLUT fonts and make things that look like they were developed in the 1990s instead of back in the days of TRON. I found FTGL, but I'm mostly a Haskell developer these days, a

Re: [Haskell-cafe] Copying Arrays

2008-05-29 Thread Jefferson Heard
Exactly. Someone on the list gave me this example awhile back for reading CSV files. I can process a gigabyte (simple unpack and print to dev/null for IO testing purposes) in about two and a half seconds using this code. import Data.ByteString.Lazy.Char8 as C -- | Read a datafile and turn it in

Re: [Haskell-cafe] Copying Arrays

2008-05-29 Thread Jefferson Heard
Define too slow, time-consuming? I've dealt with this problem a lot at this point, and I've been able to slurp up CSV files of several gigabytes in the same amount of time as I generally do in C. I have a feeling an array solution is just going to bog you down more, however if you insist, I would

Re: [Haskell-cafe] Trying to build a stand-alone executable GLUT app with ghc, Windows XP

2008-04-25 Thread Jefferson Heard
Google "download glut32.dll" and pull that file down and put it in the directory with your executable. I'd attach it myself, but gmail won't let me. I use that all the time, though. 2008/4/25 Peter Schmitz <[EMAIL PROTECTED]>: > Problem summary > > Trying to build a stand-alone executable GLUT

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Jefferson Heard
Ralph Glass has a Xiang Qi board: http://xiangqiboard.blogspot.com/ On Mon, Apr 21, 2008 at 11:22 AM, Dougal Stanton <[EMAIL PROTECTED]> wrote: > I'm having a go at making a functional board game (the back-end logic > for one, at least) and as with all good projects it raises lots of > questions

[Haskell-cafe] BUG: genObjectNames dies on Win32

2008-03-24 Thread Jefferson Heard
Could this get forwarded on to another more appropriate maling list? Confirmed on GHC and GHCi 6.6 and 6.8, Graphics.Rendering.OpenGL.GL.genObjectNames n is dying if I ask it to return an IO :: [DisplayList] For an example, just open GHCI and change context to Graphics.Rendering.OpenGL.GL and do

[Haskell-cafe] Thanks for the help: image of draft visualization

2008-03-07 Thread Jefferson Heard
Thanks for everyone's help on the list re my Haskell woes with the latest visualization effort. I've been making my code more generic for the last week, and I plan on releasing a visualization framework back to the community at some point. Gotta get approval from my boss before releasing code back

[Haskell-cafe] Failing to make `par`

2008-03-03 Thread Jefferson Heard
I've used Control.Parallel and Control.Parallel.Strategies extensively in the past, and I thought I knew what I was doing. I declared the following function: findSupernodes' :: S.Set Name -> Int -> Tree -> Protein.Tree -> S.Set Name findSupernodes' set size (Node i _ _ s il ir) (Protein.Node _ pl

Re: [Haskell-cafe] Error I haven't seen before

2008-02-28 Thread Jefferson Heard
It does. Thank you... On Thu, Feb 28, 2008 at 5:00 PM, Albert Y. C. Lai <[EMAIL PROTECTED]> wrote: > Jefferson Heard wrote: > > Main: No match in record selector Protein.go_terms > > data R = A { sa :: Int } | B { sb :: Int } > > sa (A 0) works (as expected). sa (B

[Haskell-cafe] Error I haven't seen before

2008-02-28 Thread Jefferson Heard
I'm getting this error when I try to render the text contained in a record structure in the Protein module. Does this mean that the thunk that could calculate go_terms is being evaluated for the first time in the program? go_terms is calculated by a Data.Map.! lookup operation. Main: No match in

Re: [Haskell-cafe] Tutorial for using the state monad or a better suggestion?

2008-02-22 Thread Jefferson Heard
Thanks. There seems to be some consensus developing around using IORefs to hold all the program state. -- Jeff On Fri, Feb 22, 2008 at 12:11 PM, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: > > On Feb 22, 2008, at 9:15 , Jefferson Heard wrote: > > > Now I'm t

[Haskell-cafe] Tutorial for using the state monad or a better suggestion?

2008-02-22 Thread Jefferson Heard
So the reason I keep pinging the list so much of late is I'm currently writing a GLUT program to visualize a heirarchical clustering of 18,000+ protein-protein interaction pairs (and associated gene-ontology terms). Thanks for the help on reading CSVs, those who wrote me back... my program intiti

Re: [Haskell-cafe] Rendering TTF fonts in Haskell and OpenGL

2008-02-17 Thread Jefferson Heard
18, 2008 12:20 AM, Brandon S. Allbery KF8NH <[EMAIL PROTECTED]> wrote: > > > > On Feb 17, 2008, at 19:13 , Jefferson Heard wrote: > > > > > In C and in Java, I can use truetype fonts in Haskell using select > > > libraries, and I'd like to be able t

[Haskell-cafe] Rendering TTF fonts in Haskell and OpenGL

2008-02-17 Thread Jefferson Heard
In C and in Java, I can use truetype fonts in Haskell using select libraries, and I'd like to be able to do the same in Haskell. Are there any portable libraries out there for loading fonts into OpenGL geometry for Haskell? I can use the vector fonts from GLUT is absolutely neccessary, but I'd li

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Jefferson Heard
Since everyone's been focusing on the IO so far, I wanted to take a quick stab at his mention of "green" vs. OS threads... I like the term "green", actually, as it's what my grandmother calls decaffeinated coffee, owing to the fact that decaf taster's choice has a big green plastic lid. Distrus

Re: [Haskell-cafe] Why is this so inefficient?

2008-02-05 Thread Jefferson Heard
I've switched to this, which gets rid of the ByteString instances fairly quickly. None of them make it into the final map. I'm still not getting any faster response out of it, and it also complains that my stack size is too small for anything about 128K records or more. import qualified Data.Byt

[Haskell-cafe] Why is this so inefficient?

2008-02-05 Thread Jefferson Heard
I thought this was fairly straightforward, but where the marked line finishes in 0.31 seconds on my machine, the actual transpose takes more than 5 minutes. I know it must be possible to read data in haskell faster than this. I'm trying to read a 100MB comma delimited file. I've tried both CSV m

Re: [Haskell-cafe] Allocating enormous amounts of memory and wondering why

2007-07-10 Thread Jefferson Heard
n) :: [Int] -> Array.UArray Int Int) . galaxyList $ points On Sun, 2007-07-08 at 14:37 -0700, Stefan O'Rear wrote: > On Sun, Jul 08, 2007 at 05:26:18PM -0400, Jefferson Heard wrote: > > I'm using the Data.AltBinary package to read in a list of 4.8 million > > floats

Re: [Haskell-cafe] Allocating enormous amounts of memory and wondering why

2007-07-08 Thread Jefferson Heard
ake that long, since on the wiki, AltBinary says it can run at around 20-50MB/sec. I assume I'm doing something *way* wrong here... On Sun, 2007-07-08 at 17:26 -0400, Jefferson Heard wrote: > I'm using the Data.AltBinary package to read in a list of 4.8 million > floats and 1.6 mi

[Haskell-cafe] Allocating enormous amounts of memory and wondering why

2007-07-08 Thread Jefferson Heard
I'm using the Data.AltBinary package to read in a list of 4.8 million floats and 1.6 million ints. Doing so caused the memory footprint to blow up to more than 2gb, which on my laptop simply causes the program to crash. I can do it on my workstation, but I'd really rather not, because I want my p

[Haskell-cafe] Odd lack of laziness

2007-06-21 Thread Jefferson Heard
Alright, I've been hacking away at what I posted the other day, and I have something that works for files that will fit entirely into memory. And then I figured out why I've been restricted to files that fit entirely into memory... One of my functions is causing the entire thing to be read in, whe

Re: [Haskell-cafe] Reading/writing packed bytes from file

2007-06-20 Thread Jefferson Heard
What about the Data.Binary module from the Hackage database? I can call C, no problem, but I hate to do something that's already been done. On Wed, 2007-06-20 at 12:02 +1000, Donald Bruce Stewart wrote: > jeff: > > I've read the documentation for some of the marshalling packages out > > there for

[Haskell-cafe] Reading/writing packed bytes from file

2007-06-19 Thread Jefferson Heard
I've read the documentation for some of the marshalling packages out there for Haskell, and I'm left confused as to which one I should be using and how to actually do what I want to do. I have a file, a little over 2gb, of packed data in the format (recordcount) records of: 4-byte int (count),

Re: [Haskell-cafe] operating on a hundred files at once

2007-04-10 Thread Jefferson Heard
Thanks, Ketil. I knew I could calcuate the mean in constant space, but I didn't think about the variance. Much appreciated. On Tue, 2007-04-10 at 08:30 +0200, Ketil Malde wrote: > On Tue, 2007-04-10 at 13:16 +1000, Duncan Coutts wrote: > > > Note, that like in your original we read each file tw

Re: [Haskell-cafe] operating on a hundred files at once

2007-04-09 Thread Jefferson Heard
It is indeed! Is that to be found in Control.Monad, I take it? On Tue, 2007-04-10 at 08:50 +1000, Duncan Coutts wrote: > On Mon, 2007-04-09 at 14:40 -0400, Jefferson Heard wrote: > > Thanks for the advice. I'm not so much interested in performance here, > > as this is j

Re: [Haskell-cafe] operating on a hundred files at once

2007-04-09 Thread Jefferson Heard
Thanks for the advice. I'm not so much interested in performance here, as this is just a one-off. Disk thrashing or not, these files are only a few hundred K apiece, and I can't imagine that the whole computation will take more than a few minutes. My question is more about how to deal with the

[Haskell-cafe] operating on a hundred files at once

2007-04-09 Thread Jefferson Heard
I have a series of NxM numeric tables I'm doing a quick mean/variance/t-test etcetera on. The cell t1 [i,j] corresponds exactly to the cells t2..N [i,j], and so it's perfectly possible to read one item at a time from each of the 100 files and compute the mean/variance etcetera on all cells that wa

Re: [Haskell-cafe] Haskell beginner

2007-03-15 Thread Jefferson Heard
Yet another Haskell Tutorial is the way I learned it. I find that subscribing to the mailing lists and reading the tutorial material is generally speaking enough. On Thursday 15 March 2007 14:30:03 arnuld wrote: > i want to start learning Haskell and willing to master it :-) i have > done some

Re: [Haskell-cafe] Parallelism on concurrent?

2007-03-13 Thread Jefferson Heard
the paper (moreover, I can see, that > googling over haskell.org is not sufficient ;-) ). > > Regards, > > Dusan > > Pepe Iborra wrote: > > On 13/03/2007, at 17:46, Jefferson Heard wrote: > >> Simon will probably chime in on it as well, but his p

Re: [Haskell-cafe] Parallelism on concurrent?

2007-03-13 Thread Jefferson Heard
Simon will probably chime in on it as well, but his paper on the subject is the best there is: http://research.microsoft.com/~simonpj/Papers/strategies.ps.gz If you have questions about the paper, I'd be happy to help, too. I worked through it myself fairly recently. -- Jeff On Tuesday 13

Re: [Haskell-cafe] literate Haskell newbie question

2007-03-09 Thread Jefferson Heard
ghc handles lhs files based on their extension. You don't need to translate it to a different format. If you want to translate > notation lhs to hs on your own (I dunno why, just if you did), the sed/grep combo cat foo.lhs | grep -e "^>" | sed "s/^> //" would work just fine. On Friday 09 Ma

Re: [Haskell-cafe] Usage of . and $

2007-03-06 Thread Jefferson Heard
Nope, I'm asking why um . IntMap.elems . IntMap.IntersectionWith (\x y -> x*y) queryVector rationalProjection won't work. On Tuesday 06 March 2007 15:14, Jeff Polakow wrote: > [EMAIL PROTECTED] wrote on 03/06/2007 02:43:03 PM: > > Usually, I can do this, but today, my brain is weak, and I'm

[Haskell-cafe] Usage of . and $

2007-03-06 Thread Jefferson Heard
Usually, I can do this, but today, my brain is weak, and I'm just trying to get this piece of code out the door. My code looks like this: weight = sum (IntMap.elems (IntMap.intersectionWith (\x y -> x*y) queryVector rationalProjection)) I know that this will work (ignorin

Re: [Haskell-cafe] Recursion

2007-03-06 Thread Jefferson Heard
Bryan, The code here does not take advantage of laziness, which is probably what you want to do, as it is much cleaner to look at and more Haskell like. In answer to your question it is tail recursive, and strict, which means that in some compilers, with some optimization flags (i.e. GHC) you

Re: [Haskell-cafe] A "real" Haskell Cookbook

2007-02-21 Thread Jefferson Heard
I second this plea. -- Jeff On Wednesday 21 February 2007 22:34, P. R. Stanley wrote: > and can I please ask anyone thinking of using special symbols to > resist the temptation. > Symbols such as the &160 used liberally in the Haskell wikibook are > totally invisible to screen readers. > I would

[Haskell-cafe] Is anyone using CUDA with haskell yet?

2007-02-21 Thread Jefferson Heard
I don't want to duplicate anyone's work, and I'm not sure that NDA would allow me to release the code in any case (have to check on it carefully), but is anyone currently using the CUDA framework from nVidia inside of Haskell for highly parallel programming? -- Jeff

Re: [Haskell-cafe] Leaves of a Tree

2007-02-21 Thread Jefferson Heard
Alternatively, the definition of your tree could include a list of linked lists, one for each level of the tree. Then you could just select the last list and it's the same as saving only the leaves from a complete inorder walk of the tree. data AltTree a = AltTree { tree_structure :: Tree a, n

Re: [Haskell-cafe] Looking for documentation on Control.Parallel.Strategies

2007-02-16 Thread Jefferson Heard
gy does. Maybe one day, when I have a parallel program actually working, I could document that... On Friday 16 February 2007 16:26, Bjorn Bringert wrote: > On Feb 16, 2007, at 21:16 , Jefferson Heard wrote: > > Is there anything that documents this further than the Haddock > > docu

[Haskell-cafe] Looking for documentation on Control.Parallel.Strategies

2007-02-16 Thread Jefferson Heard
Is there anything that documents this further than the Haddock documentation available from Haskell.org or the GHC pages? I've gotten some basic parallelism to work using parMap and using >|| and >|, but I had a fold and a map that I could logically compute at the same time. I found this exa

Re: [Haskell-cafe] Difference between Lazy ByteStrings and Strings in alex

2007-02-13 Thread Jefferson Heard
Yes, that was a typo :-) On Tuesday 13 February 2007 22:54, Stefan O'Rear wrote: > On Tue, Feb 13, 2007 at 10:43:11PM -0500, Jefferson Heard wrote: > > I am running GHC 2.6 now, and am using -O3 as my optimization parameter. > > I'm > > I think you will get much

[Haskell-cafe] Difference between Lazy ByteStrings and Strings in alex

2007-02-13 Thread Jefferson Heard
It was suggested that I might derive some performance benefit from using lazy bytestrings in my tokenizer instead of regular strings. Here's the code that I've tried. Note that I've hacked the "basic" wrapper code in the Lazy version, so the code should be all but the same. The only thing I h

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
gt; <mailto:[EMAIL PROTECTED]>> wrote: > > > > On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: > > > Hi, I am running the following code against a 210 MB file in an > > > > attempt to > > > > > determine whether I shou

Re: [Haskell-cafe] Re: Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
Didn't think it was overly slow, just that I could do better :-). On Tuesday 13 February 2007 16:30, [EMAIL PROTECTED] wrote: > Jefferson Heard wrote: > > Argh, bitten by the scheme bug! Right -- NO tail recursion... So that > > leaves me with some rather non-intuitive stra

Re: [Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
On Tuesday 13 February 2007 15:59, Duncan Coutts wrote: > On Tue, 2007-02-13 at 15:27 -0500, Jefferson Heard wrote: > > Hi, I am running the following code against a 210 MB file in an attempt > > to determine whether I should use alex or whether, since my needs are > > very pe

[Haskell-cafe] Strange memory consumption problems in something that should be tail-recursive

2007-02-13 Thread Jefferson Heard
Hi, I am running the following code against a 210 MB file in an attempt to determine whether I should use alex or whether, since my needs are very performance oriented, I should write a lexer of my own. I thought that everything I'd written here was tail-recursive, but after compiling this with