[Haskell-cafe] announce: hgdbmi (GDB/MI interface)

2008-03-30 Thread Evan Martin
Just in case someone else needed this, here you go: GDB/MI lets programs drive GDB. It can be used, for example, by GDB frontends. This module wraps attaching GDB to a process and parsing the (surprisingly complicated) GDB/MI output. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hgdbm

[Haskell-cafe] runInteractiveCommand dying uncatchably?

2008-03-01 Thread Evan Martin
If I run the following program, it never prints "done". If I uncomment the commented line, it does. import Prelude hiding (catch) import Control.Exception import System.Process import System.IO demo = do putStrLn "starting" (inp,out,err,pid) <- runInteractiveCommand "nonesuchcommand" putSt

[Haskell-cafe] parsing c

2008-02-24 Thread Evan Martin
I'd like to parse some C headers for a toy project. It seems like c2hs probably has the functionality I want, but it's not packaged up as a library. So two questions: Is there an alternative C-parsing library? Has anyone looked into librarifying c2hs's parser?

[Haskell-cafe] announce: (preliminary) dbus haskell bindings

2006-07-17 Thread Evan Martin
"D-Bus is a message bus system, a simple way for applications to talk to one another." [1] It's particularly popular on free software desktops (Gnome, KDE). HDBus wraps the DBus APIs so your Haskell code can broadcast messages and make calls to services. For example, on my recent Ubuntu system, t

[Haskell-cafe] packaging modules with internal-only functions

2006-07-15 Thread Evan Martin
I'm writing an FFI bindings module, and one of the pieces from the library I want to wrap is their "Error" type. module Error where To the user of the module, I'd like to only expose the nicely wrapped interface: data Error = Error String String instance Typeable Error where ... -- for throwD

Re: [Haskell-cafe] Windows PowerShell "Monad"

2006-07-15 Thread Evan Martin
On 7/16/06, Chad Scherrer <[EMAIL PROTECTED]> wrote: On 7/15/06, Krasimir Angelov <[EMAIL PROTECTED]> wrote: > Mostly coincidence. It isn't a good choice for name, I think but the > same is true for .NET. Each time when I am googling for .NET I receive > lots of irrelevant results. The same will

Re: [Haskell-cafe] Filtering on data constructors with TH

2006-06-01 Thread Evan Martin
On 6/1/06, Christophe Poucet <[EMAIL PROTECTED]> wrote: That's why today I have created an automated derivation for data constructor filtering. As I started coding someone mentioned that something similar can be done with list comprehensions, so I'm not certain about the scope of usefulness, howe

Re: [Haskell-cafe] parsing machine-generated natural text

2006-05-20 Thread Evan Martin
On 5/21/06, Evan Martin <[EMAIL PROTECTED]> wrote: Thanks! I had looked at using the lexeme parser before but it didn't seem like you can make newlines significant. Upon further consideration I realized that you can mix lexeme-based parsers with "plain" parsers. I thin

Re: [Haskell-cafe] parsing machine-generated natural text

2006-05-20 Thread Evan Martin
On 5/21/06, Udo Stenzel <[EMAIL PROTECTED]> wrote: do power colon integer reserved "Supply centers," integer reserved "Units:" ((reserved "Builds" >> return id) <|> (reserved "Disbands" >> return negate)) `ap` integer reserved "units." <|> reserved "unit." Co

[Haskell-cafe] parsing machine-generated natural text

2006-05-19 Thread Evan Martin
For a toy project I want to parse the output of a program. The program runs on someone else's machine and mails me the results, so I only have access to the output it generates, Unfortunately, the output is intended to be human-readable, and this makes parsing it a bit of a pain. Here are some

Re: [Haskell-cafe] [newbie] processing large logs

2006-05-13 Thread Evan Martin
On 5/14/06, Eugene Crosser <[EMAIL PROTECTED]> wrote: main = printMax . (foldr processLine empty) . lines =<< getContents [snip] The thing kinda works on small data sets, but if you feed it with 250,000 lines (1000 distinct), the process size grows to 200 Mb, and on 500,000 lines I get "*** Excep

Re: [Haskell-cafe] RE: transactional cache

2006-05-12 Thread Evan Martin
On 5/13/06, Alberto G. Corona <[EMAIL PROTECTED]> wrote: > notglobal = newIORef True > main = do a <- notglobal > b <- notglobal Thanks. I got the poit more or less; Each invocation creates a new IORef instance. Another way of looking at this, that might be more instructive, is that no

Re: [Haskell-cafe] Code review: efficiency question

2006-05-01 Thread Evan Martin
I remember reading a tutorial that pointed out that you can often avoid explicit recusion in Haskell and instead use higher-level operators. For your code, I think drawModals = foldr (flip (>>)) (return ()) . map drawModal works(?). On 5/2/06, Brian Hulley <[EMAIL PROTECTED]> wrote: Hi - I sta

Re: [Haskell-cafe] Newbie "Instance Of Floating Int" Error

2006-04-28 Thread Evan Martin
On 4/28/06, Aditya Siram <[EMAIL PROTECTED]> wrote: > type Point = (Int,Int) > distBetween :: Point -> Point -> Float > >>ERROR - Type error in explicitly typed binding > *** Term : distBetween > *** Type : Point -> Point -> Int > *** Does not match : Point -> Point -> Float > >