Re: [Haskell-cafe] How to generalize executing a series of commands, based on a list?

2010-11-18 Thread Peter Schmitz
Thank you very much for the help. -- Peter On Thu, Nov 18, 2010 at 4:48 AM, Scott Turner 1hask...@pkturner.org wrote: On 2010-11-17 21:03, Peter Schmitz wrote: I am wondering how to generalize this to do likewise for a series of commands, where the varying args (filenames, in this case

Re: [Haskell-cafe] Re: How to generalize executing a series of commands, based on a list?

2010-11-18 Thread Peter Schmitz
. If you want to stop processing the rest of the list on error, either write a recursive function yourself or use foldM or use ErrorT Monad Transformer. On Nov 18, 3:03 am, Peter Schmitz ps.hask...@gmail.com wrote: I am able to use System.Cmd (system) to invoke a shell command

Re: [Haskell-cafe] Re: How to generalize executing a series of commands, based on a list?

2010-11-18 Thread Peter Schmitz
again! -- Peter On Thu, Nov 18, 2010 at 3:44 PM, Henk-Jan van Tuyl hjgt...@chello.nlwrote: On Thu, 18 Nov 2010 21:20:10 +0100, Peter Schmitz ps.hask...@gmail.com wrote: Thank you very much for the help. Good tips for improving my code design. I'm new to sequence, mapM, and mapM_; I've seen mapM

[Haskell-cafe] How to generalize executing a series of commands, based on a list?

2010-11-17 Thread Peter Schmitz
I am able to use System.Cmd (system) to invoke a shell command and interpret the results. Please see the code below that works okay for one such command. (I invoke a program, passing two args.) I am wondering how to generalize this to do likewise for a series of commands, where the varying args

Re: [Haskell-cafe] Unexpected results from ExitCode

2010-11-04 Thread Peter Schmitz
Dean, Thanks very much, that indeed worked. -- Peter On Wed, Nov 3, 2010 at 9:16 PM, Dean Herington heringtonla...@mindspring.com wrote: At 8:45 PM -0700 11/3/10, Peter Schmitz wrote: I have a program (test.hs):  module Main (main) where  import System.Exit  main :: IO ExitCode  main

[Haskell-cafe] Unexpected results from ExitCode

2010-11-03 Thread Peter Schmitz
I have a program (test.hs): module Main (main) where import System.Exit main :: IO ExitCode main = do return (ExitFailure 1) In another program, I invoke it via 'system': exitCode - system .\\test.exe case (exitCode) of ExitFailure failCnt - do putStrLn $ --

[Haskell-cafe] Regression test utility suggestions?

2010-10-21 Thread Peter Schmitz
I am seeking suggestions for a regression test utility or framework to use while developing in Haskell (in a MS Windows environment). I am developing a Haskell application that parses an input text file, and outputs some information about what was parsed. The application is currently in a GUI,

[Haskell-cafe] Re: Parsec question (new user): unexpected end of input

2010-09-29 Thread Peter Schmitz
Antoine and Christian: Many thanks for your help on this thread. (I am still digesting it; much appreciated; will post when I get it working.) -- Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Parsec question (new user): unexpected end of input

2010-09-28 Thread Peter Schmitz
I am a new Parsec user, and having some trouble with a relatively simple parser. The grammar I want to parse contains tags (not html) marked by angle brackets (e.g., some tag), with arbitrary text (no angle brackets allowed) optionally in between tags. Tags may not nest, but the input must begin

Re: [Haskell-cafe] parsec manyTill documentation question

2010-09-27 Thread Peter Schmitz
On Fri, Sep 24, 2010 at 9:28 PM, Evan Laforge qdun...@gmail.com wrote: simpleComment = do{ string !--                   ; manyTill anyChar (try (string --))                   } Note the overlapping parsers anyChar and string !--, and therefore the use of the try combinator. First, I would

Re: [Haskell-cafe] parsec manyTill documentation question

2010-09-27 Thread Peter Schmitz
Stephen, Thanks much for the pointer to the examples in the sources; found them. (Its nice to learn from the coding style used by the authors.) -- Peter On Sat, Sep 25, 2010 at 12:34 AM, Stephen Tetley stephen.tet...@gmail.com wrote: On 25 September 2010 05:30, Evan Laforge qdun...@gmail.com

[Haskell-cafe] parsec manyTill documentation question

2010-09-24 Thread Peter Schmitz
I am new to parsec and having difficulty understanding the explanation of manyTill in http://legacy.cs.uu.nl/daan/download/parsec/parsec.html. (I really appreciate having this doc by the way; great reference.) I.e.: manyTill :: GenParser tok st a - GenParser tok st end - GenParser tok st [a]

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-17 Thread Peter Schmitz
Ivan, Duncan, Thank you both very much for your kind help and comments. I'm really impressed with the quality of help at Haskell Cafe, and Cabal really has worked great for me; I'll just avoid upgrade in the future. Anyone: So, to get a clean start with my library situation I will delete my

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-16 Thread Peter Schmitz
This gets a little hilarious (but better to laugh than cry). Well, I decided to try Parsec version 3 (i.e., 3.1.0) after all, and edited my cabal config to include: preference: parsec = 3 I did not include base = 4; hope that is not a problem. I did cabal upgrade parsec, which went great. It

Re: [Haskell-cafe] Simple Parsec example, question

2010-09-15 Thread Peter Schmitz
Antoine, Thank you very much for your reply. Adding type sigs did help me think about it. I got it to work. I replaced: eol = char '\n' textLines = endBy eol with: textLine :: Parser String textLine = do x - many (noneOf \n) char '\n' return x textLines :: Parser [String]

Re: [Haskell-cafe] Simple Parsec example, question

2010-09-15 Thread Peter Schmitz
Daniel, Thanks much; the more I learn Haskell and Parsec, the more I like them. -- Peter On Wed, Sep 15, 2010 at 4:02 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: On Wednesday 15 September 2010 23:01:34, Peter Schmitz wrote: textLine :: Parser String textLine = do    x - many

[Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Peter Schmitz
Not that I'm having any problem with parsec 2.1.0.1, but I guess I would like to install the latest (3.1.0), unless there is a reason not to. I can't seem to get Cabal to do so; thanks in advance for any help. I don't understand part of the output from cabal install --dry-run --reinstall -v

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Peter Schmitz
Thomas, Ivan, Thanks much for the info. -- Peter On Wed, Sep 15, 2010 at 8:00 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 16 September 2010 12:47, Peter Schmitz ps.hask...@gmail.com wrote: Not that I'm having any problem with parsec 2.1.0.1, but I guess I would like

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-15 Thread Peter Schmitz
not to, but it's good to know how Cabal works. I am finding developing in Haskell + Gtk2Hs + Glade + Parsec a lot of fun. Parser combinators are so cool. -- Peter On Wed, Sep 15, 2010 at 8:15 PM, Jason Dagit da...@codersbase.com wrote: On Wed, Sep 15, 2010 at 7:47 PM, Peter Schmitz ps.hask

[Haskell-cafe] Simple Parsec example, question

2010-09-14 Thread Peter Schmitz
Simple Parsec example, question I am learning Parsec and have been studying some great reference and tutorial sites I have found (much thanks to the authors), including: http://legacy.cs.uu.nl/daan/download/parsec/parsec.html#UserGuide

[Haskell-cafe] Re: Trying to compile Glade Gtk2Hs demo / cabal install glade problem

2010-08-13 Thread Peter Schmitz
Thanks so very much Axel and Ivan. You were both absolutely correct and I can compile Glade apps now fine. Great help! The tricky part (for me) would have been looking at the error from cabal install glade: setup.exe: The pkg-config package libglade-2.0 version =2.0.0 is required but it

[Haskell-cafe] Trying to compile Glade Gtk2Hs demo / cabal install glade problem

2010-08-12 Thread Peter Schmitz
(I am posting this to Cafe and Gtk2Hs Users; if you subscribe to both, please reply to Cafe; but I will see your replies either place; thanks much.) I am trying to compile the Gtk2Hs demo program GladeTest.hs (located in the ...\demo\glade dir), under MS Windows XP. The error I get is:

Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-29 Thread Peter Schmitz
I have a question about finding the Gtk2Hs demos (the demos written in Haskell). To summarize what I have done so far: I'm a new Cabal user; need to use Cabal in a Windows XP environment, where it and the Haskell Platform are located on a network drive (H:) instead of C:. (Need to be able to do

Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-28 Thread Peter Schmitz
Rogan: Again, thanks very much for your reply. My situation is that I need to be able to use Cabal (and the Haskell Platform, Gtk2Hs, etc.) at any of several PCs in a (Windows XP) LAN, each of which has access to the network drive H:. So, I am using: H:\proc\tools\Haskell Platform

Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-28 Thread Peter Schmitz
Rogan is right. You just need to edit the cabal config file to point to locations on your other drive. I would suggest not relocating the config file itself. If you really must do so then you can use the --config-file flag or the environment variable CABAL_CONFIG. Duncan I will try

Re: [Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-27 Thread Peter Schmitz
this. Is there (hopefully) a combination of cabal command line switches that will create a new config file over on H: for me, or must I edit the config file directly and move it to H:? And then, how do I invoke cabal each time, to get it to use its tree on H: (and ignore C:) ? Thanks (very much) in advance. -- Peter

[Haskell-cafe] new Cabal user question -- installing to Haskell Platform on Windows network drive?

2010-07-26 Thread Peter Schmitz
installation. (I have not used Cabal before.) I would prefer to do this without admin privs, if possible. ** If anyone could help me out here with a step-by-step, I would appreciate it. Hopefully the procedure for glade will then be similar. Thanks (very much) in advance. -- Peter Schmitz

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

2008-04-25 Thread Peter Schmitz
Problem summary Trying to build a stand-alone executable GLUT app with ghc, Windows XP Problem description I compile and link (without errors) a simple GLUT application under Windows XP. When I run it, XP pops an error window saying the app cannot start due to a missing glut32.dll. I want to

[Haskell-cafe] Unbuffered character IO under Windows XP?

2007-12-28 Thread Peter Schmitz
module Main(main) where import System.IO main = do b1 - hGetBuffering stdin print b1 b2 - hGetBuffering stdout print b2 -- not sure if these help, or are needed hSetBuffering stdin NoBuffering hSetBuffering stdout NoBuffering b1 - hGetBuffering stdin print b1 b2 -