Re: [Haskell-cafe] Partial statical linking

2012-09-19 Thread Christian Maeder
Hi, I usually just copy those .a files (that should be linked statically) into `ghc --print-libdir`. HTH Christian Am 19.09.2012 13:06, schrieb Jason Dusek: 2011/12/1 Irene Knapp ireney.kn...@gmail.com: The typical trick to force GHC to statically link a C library is to give the full path

Re: [Haskell-cafe] parsec: parserFail multiple error messages

2012-08-09 Thread Christian Maeder
The error message can be improved in your examples by using count 5 instead of many1. C. Am 08.08.2012 21:24, schrieb silly: I am trying to create a parsec parser that parses an integer and then checks if that integer has the right size. If not, it generates an error. I tried the

Re: [Haskell-cafe] Need help with learning Parsec

2012-07-23 Thread Christian Maeder
Am 22.07.2012 17:21, schrieb C K Kashyap: I've updated the parser here - https://github.com/ckkashyap/LearningPrograms/blob/master/Haskell/Parsing/xml_3.hs The whole thing is less than 100 lines and it can handle comments as well. This code is still not nice: Duplicate code in openTag and

Re: [Haskell-cafe] how to select random elements of a Data.Set?

2012-07-20 Thread Christian Maeder
Am 20.07.2012 15:24, schrieb jwaldmann: Dear all, how would I quickly select an element of a Set (as in Data.Set) uniformly at random? If you use a Map a () (or Map a a) you can use Map.elemAt. The initial conversion is still linear, though. -- | convert a set into an identity map setToMap

Re: [Haskell-cafe] Need help with learning Parsec

2012-07-19 Thread Christian Maeder
Am 19.07.2012 14:53, schrieb C K Kashyap: Dear gentle Haskellers, I was trying to whet my Haskell by trying out Parsec today to try and parse out XML. Here's the code I cam up with - I wanted some help with the gettext parser that I've written. I had to do a dummy char ' ') in there just to

Re: [Haskell-cafe] Need help with learning Parsec

2012-07-19 Thread Christian Maeder
Am 19.07.2012 14:53, schrieb C K Kashyap: innerXML = do x - (try xml | gettext) return x Omit try (and return). xml always starts with whereas gettext never does. C. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Need help with learning Parsec

2012-07-19 Thread Christian Maeder
Am 19.07.2012 15:14, schrieb Christian Maeder: Am 19.07.2012 14:53, schrieb C K Kashyap: innerXML = do x - (try xml | gettext) return x Omit try (and return). xml always starts with whereas gettext never does. I was wrong, you do not want to swallow an endTag as openTag

Re: [Haskell-cafe] Need help with learning Parsec

2012-07-19 Thread Christian Maeder
Am 19.07.2012 15:26, schrieb Christian Maeder: Am 19.07.2012 15:14, schrieb Christian Maeder: Am 19.07.2012 14:53, schrieb C K Kashyap: innerXML = do x - (try xml | gettext) return x Omit try (and return). xml always starts with whereas gettext never does. I was wrong

Re: [Haskell-cafe] Need help with learning Parsec

2012-07-19 Thread Christian Maeder
by: openTag = try (char '' * many1 (noneOf /)) * char '' C. endTag :: String - Parser String endTag str = string / * string str * char '' Well yes, modified to what Christian Maeder just suggested. Cheers, Simon ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Associative prefix operators in Parsec

2012-03-12 Thread Christian Maeder
Am 08.03.2012 17:16, schrieb Troels Henriksen: Christian Maederchristian.mae...@dfki.de writes: The simplest solution is to parse the prefixes yourself and do not put it into the table. (Doing the infixes and | by hand is no big deal, too, and possibly easier then figuring out the

Re: [Haskell-cafe] Associative prefix operators in Parsec

2012-03-08 Thread Christian Maeder
The simplest solution is to parse the prefixes yourself and do not put it into the table. (Doing the infixes and | by hand is no big deal, too, and possibly easier then figuring out the capabilities of buildExpressionParser) Cheers C. Am 07.03.2012 13:08, schrieb Troels Henriksen:

Re: [Haskell-cafe] How to split this string.

2012-01-05 Thread Christian Maeder
Am 05.01.2012 11:57, schrieb Steve Horne: [...] groupCut :: (x - x - Bool) - [x] - [[x]] [...] How about a break function that respects an escape character (1. arg) (and drops the delimiter - 2. arg) and use this function for unfolding? import Data.List break' :: (a - Bool) - (a - Bool) -

Re: [Haskell-cafe] How to split this string.

2012-01-05 Thread Christian Maeder
Am 05.01.2012 13:04, schrieb Steve Horne: [...] I was going to accuse you of cheating - who says there's a spare value to use? - but you seem to be using Maybe, so well played. You're also using unfoldr, which I really must play with a bit - I don't really have a feel for how unfolding works

Re: [Haskell-cafe] How to split this string.

2012-01-04 Thread Christian Maeder
Am 04.01.2012 17:47, schrieb Steve Horne: On 02/01/2012 11:12, Jon Fairbairn wrote: maxm...@mtw.ru writes: I want to write a function whose behavior is as follows: foo string1\nstring2\r\nstring3\nstring4 = [string1, string2\r\nstring3, string4] Note the sequence \r\n, which is ignored. How

Re: [Haskell-cafe] How to split this string.

2012-01-02 Thread Christian Maeder
Am 02.01.2012 10:44, schrieb max: I want to write a function whose behavior is as follows: foo string1\nstring2\r\nstring3\nstring4 = [string1, string2\r\nstring3, string4] Note the sequence \r\n, which is ignored. How can I do this? replace the sequence by something unique first, i.e. a

Re: [Haskell-cafe] Operator precedence and associativity with Polyparse

2011-10-26 Thread Christian Maeder
Am 26.10.2011 01:49, schrieb Tom Hawkins: Can someone provide guidance on how handle operator precedence and associativity with Polyparse? Do you mean parsing something like 1 + 2 * 3 ? I don't think there's any real difference in using Polyparse vs Parsec for this, except for doing p

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-21 Thread Christian Maeder
Am 20.10.2011 21:43, schrieb Michael Snoyman: On Wed, Oct 19, 2011 at 9:29 PM, Ketil Maldeke...@malde.org wrote: Michael Snoymanmich...@snoyman.com writes: sense to try and pursue something like what you're suggesting, but I think the default Show (Vector Word8) should be the one most

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-18 Thread Christian Maeder
Am 12.10.2011 16:02, schrieb Bas van Dijk: API DOCS http://hackage.haskell.org/package/vector-bytestring-0.0.0.0 you could re-export VS.empty, VS.singleton, etc. directly. Cheers Christian -- | /O(1)/ The empty 'ByteString' empty :: ByteString empty = VS.empty {-# INLINE empty #-} -- |

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Christian Maeder
I think the cleanest solution (just from a theoretical point of view) is to use a newtype for your byte strings. - it should have the same performance - allows to make ByteString really abstract when hiding the newtype constructor - is portable and supplies control over all other instances

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Christian Maeder
Am 17.10.2011 11:10, schrieb Ertugrul Soeylemez: So please, please, please, if you decide to use a newtype, do /not/ hide the constructor. The better alternative to not hiding the constructor is to supply conversion functions that may or may not do more than the constructor and selector and

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Christian Maeder
Am 17.10.2011 12:14, schrieb Bas van Dijk: On 17 October 2011 10:18, Christian Maederchristian.mae...@dfki.de wrote: I think the cleanest solution (just from a theoretical point of view) is to use a newtype for your byte strings. - it should have the same performance - allows to make

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Christian Maeder
Am 17.10.2011 12:19, schrieb Michael Snoyman: [...] Also, aren't there a few documented cases where newtypes prevent certain GHC rewrite rules from firing? This would be possible to find out with a wrapper module. Cheers Christian I don't see any strong argument to avoid what appears to be

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-17 Thread Christian Maeder
Am 17.10.2011 17:26, schrieb Bas van Dijk: On 17 October 2011 13:12, Christian Maederchristian.mae...@dfki.de wrote: So your package basically supports an unfortunate mix of bytestring and vector functions? No, vector-bytestring exports the same API as bytestring (except for the Show and

Re: [Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

2011-10-14 Thread Christian Maeder
Am 12.10.2011 16:02, schrieb Bas van Dijk: All your ByteString are belong to us... Hello, I'm pleased to announce the beta release of vector-bytestring. This library provides the type ByteString which is defined as a type synonym for a storable Vector of Word8s (from the vector package):

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-10 Thread Christian Maeder
Am 08.10.2011 16:04, schrieb Captain Freako: Hi all, In this definition from the Parsec library: parse :: (Stream s Identity t) = Parsec s () a - SourceName - s - Either ParseError a parse p = runP p () what's the significance of `Identity t'? (`t' isn't used

Re: [Haskell-cafe] Parsec line number off-by-one

2011-09-21 Thread Christian Maeder
Hi, 1. your lookAhead is unnecessary, because your items (atomNames) never start with %. 2. your try fails in (line 12, column 1), because the last item (aka atomName) starts consuming \n, before your eol parser is called. So rather than calling spaces before every real atom, I would call

Re: [Haskell-cafe] GHC/Cabal on AFS

2011-09-06 Thread Christian Maeder
I had similar problems under Solaris with ghc binaries compiled using gcc-4.3.3 http://hackage.haskell.org/trac/ghc/ticket/5013 C. Am 05.09.2011 19:06, schrieb Tristan Ravitch: I have the Haskell Platform (and my home directory with my cabal-installed packages) installed on an AFS (a

Re: [Haskell-cafe] Trouble with readProcess

2011-08-11 Thread Christian Maeder
Am 11.08.2011 16:45, schrieb Charles-Pierre Astolfi: Hi -cafe, I'm using readProcess and I don't know how to handle this issue: readProcess cmd [opt1,opt2] seems to execute the following: are you sure that your argument strings do not contain the quotes, possibly by calling show on

Re: [Haskell-cafe] Regular Expression Parsing via derivatives

2011-08-02 Thread Christian Maeder
Am 01.08.2011 17:51, schrieb Alex Clemmer: Hi Haskell people, I've been snooping through various mailing lists and the current Haskell implementation of regular expressions and I was wondering if there has been a discussion about implementing regex parsing with derivatives. If so, I haven't

Re: [Haskell-cafe] Inconsistent trailing comma in export list and record syntax

2011-07-12 Thread Christian Maeder
Generally allowing trailing (or leading or repeated) commas would clash with tuple sections. Also the pair constructor (,) is a special case. http://www.haskell.org/ghc/docs/7.0.4/html/users_guide/syntax-extns.html#tuple-sections Cheers Christian Am 11.07.2011 12:09, schrieb Joachim Breitner:

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Christian Maeder
Am 14.04.2011 12:29, schrieb Dmitri O.Kondratiev: 3n+1 is the first, warm-up problem at Programming Chalenges site: http://www.programming-challenges.com/pg.php?page=downloadproblemprobid=110101format=html http://www.programming-challenges.com/pg.php?page=downloadproblemprobid=110101format=html

Re: [Haskell-cafe] how to optmize this code?

2011-03-31 Thread Christian Maeder
Am 31.03.2011 05:59, schrieb Felipe Almeida Lessa: On Wed, Mar 30, 2011 at 2:39 PM, Gilberto Garciagiba@gmail.com wrote: fkSum :: Int - [Int] - Int fkSum a [] = 0 fkSum a (b) = foldl (+) 0 (filter (\x - isMultiple x b) [1..a]) Daniel Fischer and Yves Parès gave you good suggestions

Re: [Haskell-cafe] Data.ByteString.Lazy.ByteString vs Data.ByteString.Lazy.Internal.ByteString

2011-03-14 Thread Christian Maeder
Am 14.03.2011 06:26, schrieb C K Kashyap: Looks like a job for Data.Binary. I'd like to use it with just the libraries that are part of the platform I forgot to mention, Data.Binary does not seem to be in the platform. Right, it is not in the platform, but I would recommend

Re: [Haskell-cafe] Update Cabal

2011-03-10 Thread Christian Maeder
What are the arguments for updating? Are you using ghc-7.0.2? Wait for Haskell Platform 2011.2.0.0 that will be based on cabal-install-0.10.2! Cheers Christian Am 10.03.2011 11:27, schrieb Hauschild, Klaus (EXT): Hallo, I'm using Haskell Platform 2010.2.0.0 on a Windows XP machine. This

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-09 Thread Christian Maeder
Am 08.03.2011 13:50, schrieb Christian Maeder: Am 08.03.2011 13:35, schrieb Hauschild, Klaus (EXT): Hi Christian, Thank you for your help. Now the current version of Parse.hs (http://code.google.com/p/hgmltracer/source/browse/trunk/hGmlTracer/src/Gml/Parse.hs) works well for the test file

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-09 Thread Christian Maeder
Am 09.03.2011 14:44, schrieb Christian Maeder: Am 08.03.2011 13:50, schrieb Christian Maeder: Am 08.03.2011 13:35, schrieb Hauschild, Klaus (EXT): Hi Christian, Thank you for your help. Now the current version of Parse.hs (http://code.google.com/p/hgmltracer/source/browse/trunk/hGmlTracer

Re: [Haskell-cafe] have anyone tried GHC 7.0.2

2011-03-08 Thread Christian Maeder
What does ghc-pkg list and ghc-pkg check say? Cabal-1.10.1.0, directory-1.1.0.0 and process-1.0.1.5 should be there after installation of GHC 7.0.2. (I've actually installed cabal-install-0.10.0 using an older cabal, but that does not work on macs and may not be the recommended way.) I think

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
lexeme.) C. The redefinition of space is not necessary, it was copied from another tutorial code. How I write a version of parseGml that get gml token separated by any white space (space, tab, newline)? Thanks -Ursprüngliche Nachricht- Von: Christian Maeder [mailto:christian.mae

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
token separated by any white space (space, tab, newline)? Thanks -Ursprüngliche Nachricht- Von: Christian Maeder [mailto:christian.mae...@dfki.de] Gesendet: Montag, 7. März 2011 14:18 An: Hauschild, Klaus (EXT) Cc: haskell-cafe@haskell.org Betreff: Re: Overlaping Parsec rules

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
- Von: Christian Maeder [mailto:christian.mae...@dfki.de] Gesendet: Montag, 7. März 2011 14:18 An: Hauschild, Klaus (EXT) Cc: haskell-cafe@haskell.org Betreff: Re: Overlaping Parsec rules Am 07.03.2011 13:48, schrieb Hauschild, Klaus (EXT): Thanks Christian, I adapted the keyword parser

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-08 Thread Christian Maeder
from another tutorial code. How I write a version of parseGml that get gml token separated by any white space (space, tab, newline)? Thanks -Ursprüngliche Nachricht- Von: Christian Maeder [mailto:christian.mae...@dfki.de] Gesendet: Montag, 7. März 2011 14:18 An: Hauschild, Klaus

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Christian Maeder
You should parse keywords using: keyword s = try (string s) notFollowedBy (letter | digit) C. Am 07.03.2011 11:34, schrieb Hauschild, Klaus (EXT): Hi, to solve this ICFP task _http://www.cs.cornell.edu/icfp/task.htm_ I'm currnetly working on the parser. With the hint from Thu (reading

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Christian Maeder
) manyTill anyChar newline or just: many (noneOf \n) (a trailing newline will be skipped by spaces) Any ideas? -Ursprüngliche Nachricht- Von: Christian Maeder [mailto:christian.mae...@dfki.de] Gesendet: Montag, 7. März 2011 12:23 An: Hauschild, Klaus (EXT) Cc: haskell-cafe

Re: [Haskell-cafe] Overlaping Parsec rules

2011-03-07 Thread Christian Maeder
Am 07.03.2011 14:20, schrieb Stephen Tetley: Hi Klaus Unless you have very specific white-space considerations, you really want to be using Parsec's Token and LanguageDef modules. Well, I would want to use Parsec's Token and LanguageDef modules just to get the white spaces (and comments to

Re: [Haskell-cafe] Proving correctness

2011-02-11 Thread Christian Maeder
Am 11.02.2011 13:48, schrieb Daniel Fischer: [...] +1 Testing can only prove code incorrect, it can never prove code correct (except for extremely simple cases where testing all possible inputs can be done; but guaranteeing that QuickCheck generates all possible inputs is generally harder

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-10 Thread Christian Maeder
Am 10.02.2011 13:15, schrieb Dušan Kolář: Well, that was probably the main problem :-( Unfortunately, even if, after performing all the stuff once again, I made platform configured, make ended in compilation of happy with old story: Configuring happy-1.18.5... ./Setup build

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-10 Thread Christian Maeder
On 02/10/2011 04:38 PM, Christian Maeder wrote: Am 10.02.2011 13:15, schrieb Dušan Kolář: Well, that was probably the main problem :-( Unfortunately, even if, after performing all the stuff once again, I made platform configured, make ended in compilation of happy with old story: Configuring

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-08 Thread Christian Maeder
Am 08.02.2011 11:39, schrieb Dušan Kolář: ghc -O2 --make test.hs -o test [1 of 1] Compiling Main ( test.hs, test.o ) ghc: could not execute: /usr/bin/gcc Even if I can easily compile gcc testc.c -o testc and run testc. Your ghc script (under /usr/local/bin or elsewhere type -all

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-08 Thread Christian Maeder
+$@} while: which gcc /usr/local/bin/gcc Dusan On 02/08/2011 12:42 PM, Christian Maeder wrote: Am 08.02.2011 11:39, schrieb Dušan Kolář: ghc -O2 --make test.hs -o test [1 of 1] Compiling Main ( test.hs, test.o ) ghc: could not execute: /usr/bin/gcc Even if I can easily

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-08 Thread Christian Maeder
Does adding -v reveal when /usr/bin/gcc is used? ghc -v -O2 --make test.hs -o test C. Am 08.02.2011 11:39, schrieb Dušan Kolář: Hello all, I'm trying to build platform on Linux 2.6.32.22 #1 SMP Tue Sep 21 09:44:04 CEST 2010 x86_64 x86_64 x86_64 GNU/Linux. I've downloaded binary of

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-08 Thread Christian Maeder
/ghc29474_0.s *** Deleting temp dirs: Deleting: /tmp/ghc29474_0 ghc: could not execute: /usr/bin/gcc Otherwise gcc not mentioned, no error mentioned. Dusan On 02/08/2011 01:04 PM, Christian Maeder wrote: Does adding -v reveal when /usr/bin/gcc is used? ghc -v -O2 --make test.hs -o test

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-08 Thread Christian Maeder
There seems to be confusion about 32bit and 64bit assembly. Can you compile and link without optimization? C. Am 08.02.2011 13:33, schrieb Dušan Kolář: Well, it helped, but not getting output anyway: /tmp/ghc32376_0/ghc32376_0.s: Assembler messages: /tmp/ghc32376_0/ghc32376_0.s:35:0:

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-08 Thread Christian Maeder
What does gcc -v say? Maybe you have to install the 32Bit ghc-6.12.3 that can work together with your gcc. Christian Am 08.02.2011 15:05, schrieb Kolar Dusan: No :-( D. There seems to be confusion about 32bit and 64bit assembly. Can you compile and link without optimization? C. Am

Re: [Haskell-cafe] Building Plaftorm 2010 2 on 64bit Linux

2011-02-08 Thread Christian Maeder
Am 08.02.2011 11:39, schrieb Dušan Kolář: Hello all, I'm trying to build platform on Linux 2.6.32.22 #1 SMP Tue Sep 21 09:44:04 CEST 2010 x86_64 x86_64 x86_64 GNU/Linux. I've downloaded binary of ghc6.12.3 for the purpose, but ghc doesn't work. ghci does work, gcc does work, but for ghc I

Re: [Haskell-cafe] Review request for platform independent interactive graphics with VNC

2011-02-04 Thread Christian Maeder
) I was not taking care of partial updates, I've taken care of it now. Btw, what vncviewer are you using? After pulling in your changes and recompilation, your application runs as expected. Thanks a lot! Christian maeder@leibniz:~ uname -a Linux [...] 2.6.34.7-0.7-desktop #1 SMP PREEMPT

Re: [Haskell-cafe] Review request for platform independent interactive graphics with VNC

2011-02-03 Thread Christian Maeder
Am 03.02.2011 12:15, schrieb C K Kashyap: Hi, I've been working on a Haskell based platform independent graphics rendering using VNC. I'd like it very much if you could take a look at it and give me feedback. Using it is straight forward - git clone g...@github.com:ckkashyap/Chitra.git

Re: [Haskell-cafe] Review request for platform independent interactive graphics with VNC

2011-02-03 Thread Christian Maeder
Am 03.02.2011 17:20, schrieb C K Kashyap: Oops, you can use git://github.com/ckkashyap/Chitra.git http://github.com/ckkashyap/Chitra.git - sorry about that. You can also visit https://github.com/ckkashyap/Chitra Thanks, I cannot get it to run with my vncviewer (TightVNC Viewer version 1.3.9)

Re: [Haskell-cafe] Review request for platform independent interactive graphics with VNC

2011-02-03 Thread Christian Maeder
, a window seems to pop up very shortly before it fails for me as shown below: Cheers Christian maeder@leibniz:~ vncviewer localhost Connected to RFB server, using protocol version 3.3 No authentication needed Desktop name Haskell Framebuffer VNC server default format: 32 bits per pixel. Most

Re: [Haskell-cafe] Review request for platform independent interactive graphics with VNC

2011-02-03 Thread Christian Maeder
FrameBufferUpdateRequest x=0, y=0 width =1, height=1 FrameBufferUpdateRequest x=1, y=0 width =99, height=1 FrameBufferUpdateRequest x=0, y=1 width =100, height=99 Main: socket: 7: hPutBuf: resource vanished (Connection reset by peer) Am 03.02.2011 18:43, schrieb Christian Maeder: Am 03.02.2011 18:05, schrieb C K

Re: [Haskell-cafe] Data.Ranges show error

2011-01-25 Thread Christian Maeder
Let's notify the maintainer to use an ordinary minus sign: http://hackage.haskell.org/package/ranges-0.2.3 my scan program (http://hackage.haskell.org/package/scan) reports: Ranges.hs:12:9: undesirable character '\t' Ranges.hs:12:51: undesirable character '\226' Ranges.hs:12:52: undesirable

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2011-01-04 Thread Christian Maeder
Am 27.12.2010 08:44, schrieb Henning Thielemann: On Mon, 27 Dec 2010, Jonathan Geddes wrote: #1 Parse a string at compile-time so that a custom syntax for representing data can be used. At the extreme, this data might even be an EDSL. I think it would be enough, if the compiler could be

Re: [Haskell-cafe] Template Haskell a Permanent solution?

2011-01-04 Thread Christian Maeder
Am 04.01.2011 15:48, schrieb Henning Thielemann: Christian Maeder schrieb: Am 27.12.2010 08:44, schrieb Henning Thielemann: On Mon, 27 Dec 2010, Jonathan Geddes wrote: #2 Provide instances automatically. http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/generic-classes.html I see

Re: [Haskell-cafe] $ do?

2010-12-16 Thread Christian Maeder
Am 15.12.2010 08:36, schrieb Roman Cheplyaka: * Jonathan Geddes geddes.jonat...@gmail.com [2010-12-14 19:59:14-0700] Quick question: Why do I need the $ in the following bits of code? main = withSocketsDo $ do --do something with sockets foo = fromMaybe 0 $ do --do something in the

Re: [Haskell-cafe] dot-ghci files

2010-12-09 Thread Christian Maeder
Am 09.12.2010 08:01, schrieb Tony Morris: I teach haskell quite a lot. I recommend using .ghci files in projects. Today I received complaints about the fact that ghci will reject .ghci if it is group-writeable. I didn't offer an opinion on the matter. I am wondering if these complaints have

[Haskell-cafe] Re: Why does cabal unnecessarily reinstall dependencies?

2010-11-23 Thread Christian Maeder
I've noticed that ghc-6.10.4 did not work well with cabal-install version 0.8.2. (cabal install gtk did not work.) Everything was fine after I switched back to: cabal-install version 0.6.2 using version 1.6.0.3 of the Cabal library and removing the Cabal 1.8... library package. Cheers

[Haskell-cafe] Re: Cabal-install is broken

2010-11-23 Thread Christian Maeder
Am 22.11.2010 23:16, schrieb Permjacov Evgeniy: current cabal-install (0.8.2) cannot be compiled with ghc-7.0.1 set of boot libraries. It requires cabal 1.8.* wich fails to compile. Does anyone worked this out ? You can re-use your old cabal binary (if you still have it) that was compiled with

[Haskell-cafe] Re: A parsec question

2010-09-30 Thread Christian Maeder
for this behaviour? (2) Is there another combinator that behaves as I would like? (3) Otherwise, how do I write one myself? ask derek.a.elk...@gmail.com (CCed) Cheers Christian I just saw that Christian Maeder answered a similar question recently. I tried his suggestion of using manyTill

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

2010-09-29 Thread Christian Maeder
Am 29.09.2010 05:35, schrieb Peter Schmitz: [...] Error parsing file: ...\sampleTaggedContent.txt (line 4, column 1): unexpected end of input expecting The input was: [...] -- Parsers: taggedContent = do optionalWhiteSpace aTag many tagOrContent aTag many tagOrContent

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

2010-09-29 Thread Christian Maeder
Am 29.09.2010 09:54, schrieb Christian Maeder: Am 29.09.2010 05:35, schrieb Peter Schmitz: [...] Error parsing file: ...\sampleTaggedContent.txt (line 4, column 1): unexpected end of input expecting The input was: [...] -- Parsers: taggedContent = do optionalWhiteSpace aTag

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

2010-09-29 Thread Christian Maeder
Am 29.09.2010 11:55, schrieb Christian Maeder: Am 29.09.2010 09:54, schrieb Christian Maeder: Am 29.09.2010 05:35, schrieb Peter Schmitz: [...] Error parsing file: ...\sampleTaggedContent.txt (line 4, column 1): unexpected end of input expecting The input was: [...] -- Parsers

[Haskell-cafe] ANN: scan-0.1.0.6, a style scanner for Haskell sources

2010-08-03 Thread Christian Maeder
Dear Haskell friends, I like to announce a new version of the style scanner for Haskell source files at http://hackage.haskell.org/package/scan documented under http://projects.haskell.org/style-scanner/ cabal update cabal install scan A short description is also here:

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

2010-07-13 Thread Christian Maeder
Andy Stewart schrieb: Hi all, We plan to release bug fix version : gtk2hs-0.11.1 Please report any bug of gtk2hs-0.11.0, we will fix it before release gtk2hs-0.11.1 I'm looking forward for this bug-fix release (since gtk2hs-0.11.0 did not work for me). Because I've almost missed this

[Haskell-cafe] Re: whine and solution about programmers not respecting documentations

2010-06-29 Thread Christian Maeder
Ketil Malde schrieb: [...] I don't think there would be any doubt what 'deleteBy (= 5) [1..10]' would do. Well, if you don't know about filter, you could think it deletes all elements satisfying the predicate, but apart from that, it's clear. I'd probably call it 'filter1', but that's just

[Haskell-cafe] Re: Pugs with GHC 6.12

2010-06-01 Thread Christian Maeder
Simon Thompson schrieb: Has anyone successfully compiled Pugs with GHC 6.12? The Pugs page suggests that it compiles, but it falls to link (and therefore build) when I try it. Your error message would help. I was able to compile and link pugs (Version: 6.2.13.15) using ghc-6.12.2.20100521 by:

[Haskell-cafe] Re: Installing ghc in an OpenSolaris Zone

2010-04-29 Thread Christian Maeder
Günther Schmidt schrieb: Hello Christin, http://www.haskell.org/ghc/download_ghc_6_10_4.html#x86solaris is supposed to work under open solaris, too. it does actually, quite nicely too, in the *global* zone. It's just when I try to install it into a separate zone the install fails. How

[Haskell-cafe] Re: Installing ghc in an OpenSolaris Zone

2010-04-27 Thread Christian Maeder
Günther Schmidt schrieb: Hello, has anyone yet managed to install ghc (6.10.4) into an OpenSolaris zone? http://www.haskell.org/ghc/download_ghc_6_10_4.html#x86solaris is supposed to work under open solaris, too. Cheers Christian ___ Haskell-Cafe

[Haskell-cafe] Re: What do _you_ want to see in FGL?

2010-04-26 Thread Christian Maeder
Ivan Lazar Miljenovic schrieb: - Having a separate parameter (using associated types?) for the node type rather than just using Int. Just Int for nodes was disappointing. It should have been at least a newtype. I would vote against these experimental features like associated types or

[Haskell-cafe] Re: What do _you_ want to see in FGL?

2010-04-26 Thread Christian Maeder
Ivan Lazar Miljenovic schrieb: I would vote against these experimental features like associated types or MPTC and FD. I prefer plain type parameters for data types, but that does not fit well together with type classes. Why don't you like extensions? I used to feel the same way, but then

[Haskell-cafe] ANN: scan-0.1.0.4, a style scanner for Haskell sources

2010-04-21 Thread Christian Maeder
I think, I've addressed the points made by Henning and Sebastian. (Don't forget to cabal update.) Cheers Christian Dear Haskell friends, I like to announce a Haskell style scanner at http://hackage.haskell.org/package/scan documented under http://projects.haskell.org/style-scanner/

[Haskell-cafe] ANN: scan-0.1.0.3, a Haskell style scanner

2010-04-19 Thread Christian Maeder
Dear Haskell friends, I like to announce a Haskell style scanner at http://hackage.haskell.org/package/scan documented under http://projects.haskell.org/style-scanner/ It's best used in conjunction with hlint http://community.haskell.org/~ndm/hlint/ and gives many suggestions regarding the

[Haskell-cafe] Re: [Haskell] ANN: scan-0.1.0.3, a Haskell style scanner

2010-04-19 Thread Christian Maeder
Sebastian Fischer schrieb: Hello Christian, On Apr 19, 2010, at 4:48 PM, Christian Maeder wrote: I like to announce a Haskell style scanner at http://hackage.haskell.org/package/scan Feedback is welcome. I get lots of multiple blanks which I'd rather not correct. I often use

Re: [Haskell-cafe] ANN: scan-0.1.0.3, a Haskell style scanner

2010-04-19 Thread Christian Maeder
Henning Thielemann schrieb: On Mon, 19 Apr 2010, Christian Maeder wrote: Dear Haskell friends, I like to announce a Haskell style scanner at http://hackage.haskell.org/package/scan At first I thought it is a scanner (for whatever purpose) implemented in Haskell style. No it checks

[Haskell-cafe] Re: compiling 32 bits haskell program on 64 bits linux

2010-03-16 Thread Christian Maeder
I think you need to install the 32bit ghc first, because you'll need all the 32bit haskell libs. At least I was able to use the 32bit ghc (version 6.8.2) on a 64 bit linux by changing the script in the bin directory from exec $GHCBIN $TOPDIROPT ${1+$@} to exec $GHCBIN -optc-m32 -opta-m32

[Haskell-cafe] Re: haskelldb problem

2010-03-02 Thread Christian Maeder
Documentation should be: http://hackage.haskell.org/packages/archive/haskelldb/0.12/doc/html/Database-HaskellDB-DBSpec.html http://hackage.haskell.org/packages/archive/haskelldb/0.12/doc/html/Database-HaskellDB-DBSpec-PPHelpers.html assuming you have the haskelldb-0.12 package installed. HTH

[Haskell-cafe] Re: Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-26 Thread Christian Maeder
Andy Gimblett schrieb: Hi Christian, [...] It may make sense to use something like readMaybe (which is missing in the Prelude) instead of read to allow the parser to fail more nicely. It seems to be kicking up reasonable errors as it is, e.g.: *Main parse aFloat 2e-h Left (line 1,

[Haskell-cafe] Re: Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-24 Thread Christian Maeder
Andy Gimblett schrieb: For the record, here's the final improved version: Hi Andy, I hope you don't mind if I make some style comments to your final version. 1. break the line after do (to avoid a layout change when change name or arguments of float' or rename the variable e) 2. The t ::

Re: [Haskell-cafe] Re: Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-24 Thread Christian Maeder
Ben Millwood schrieb: On Wed, Feb 24, 2010 at 1:24 PM, Christian Maeder christian.mae...@dfki.de wrote: 1. break the line after do (to avoid a layout change when change name or arguments of float' or rename the variable e) You can also break it immediately before do, which I think

[Haskell-cafe] Re: Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-23 Thread Christian Maeder
Andy Gimblett schrieb: Hi all, Short version: How can I pretty print and parse values of type Double such that those operations are each other's inverse? Maybe you have more luck with show and read (without Parsec.Token). Your example: x = 9.91165677454629 fails because the computation

[Haskell-cafe] Re: Installing wx via cabal

2010-02-22 Thread Christian Maeder
Dušan Kolář schrieb: Dear all, Running cabal install --global wx stops very soon with the following error. Building wxcore-0.12.1.2... [...] dist/build/Graphics/UI/WXCore/WxcClassesAL.o ) ghc: out of memory (requested 1048576 bytes) cabal: Error: some packages failed to install: It

[Haskell-cafe] Re: Cabal broken on Mac OS X?

2010-02-19 Thread Christian Maeder
Oleg Lobachev schrieb: Hello all, I suspect that it's me and not the cabal, but everything looks fine and still fails. Would someone mind to tell me, what am I doing wrong? $ cabal -V cabal-install version 0.6.2 using version 1.6.0.3 of the Cabal library This version of cabal cannot

[Haskell-cafe] Re: Cabal update problem

2010-02-19 Thread Christian Maeder
Maciej Podgurski schrieb: Hi, after updating to cabal-install-0.8.0/Cabal-1.8.0.2 with GHC 6.10.4, I always get an error when updating the package list: cabal update Downloading the latest package list from hackage.haskell.org cabal: Codec.Compression.Zlib: premature end of

Re: [Haskell-cafe] Re: Cabal update problem

2010-02-19 Thread Christian Maeder
Christian Maeder: Maciej Podgurski schrieb: Hi, after updating to cabal-install-0.8.0/Cabal-1.8.0.2 with GHC 6.10.4, I always get an error when updating the package list: cabal update Downloading the latest package list from hackage.haskell.org cabal: Codec.Compression.Zlib

[Haskell-cafe] Re: Infix and postfix operators in Parsec

2010-02-12 Thread Christian Maeder
It seems that the case of identical postfix and infix operators was not considered. So I recommend to write something from scratch. Cheers Christian Xinyu Jiang schrieb: I'm writing a parser for a Haskell-style language, and when I need to use the same symbol for infix, prefix and postfix

[Haskell-cafe] Re: Infix and postfix operators in Parsec

2010-02-12 Thread Christian Maeder
Parse a sequence of primitive expressions first and then do fixity resolution independent from Parsec. C. Christian Maeder schrieb: It seems that the case of identical postfix and infix operators was not considered. So I recommend to write something from scratch. Cheers Christian Xinyu

[Haskell-cafe] Re: Translation of Haskell type classes

2010-02-04 Thread Christian Maeder
try: type DictMyEq a = a - a - Bool -- From the definition of type class MyOrd type DictOrd a = (DictMyEq a, a - a - Bool) data Nat = Z | S Nat -- From the instance MyEq Nat eqNat :: Nat - Nat - Bool eqNat Z Z = True eqNat Z (S x) = False eqNat (S x) Z = False eqNat (S x) (S y)

[Haskell-cafe] Re: ghc: unrecognised flags: -I

2010-01-25 Thread Christian Maeder
Lyndon Maydwell schrieb: For example, when I cabal install -v storable-complex I get the following: /usr/bin/ghc -package-name storable-complex-0.2.1 --make -hide-all-packages -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -I -optP-include

[Haskell-cafe] Re: Why no merge and listDiff?

2010-01-22 Thread Christian Maeder
Will Ness schrieb: Christian Maeder Christian.Maeder at dfki.de writes: Will Ness schrieb: I meant strictly increasing ordered lists, without multiples, for which the two operations, 'merge' and 'minus', would also have to produce like lists, i.e strictly increasing, without multiples

[Haskell-cafe] Re: Why no merge and listDiff?

2010-01-20 Thread Christian Maeder
Will Ness schrieb: I meant strictly increasing ordered lists, without multiples, for which the two operations, 'merge' and 'minus', would also have to produce like lists, i.e strictly increasing, without multiples. Why don't you use directly Data.Set? I guess the first variety is more

[Haskell-cafe] Re: deleteBy type too restrictive

2010-01-15 Thread Christian Maeder
There's already a ticket for this proposal http://hackage.haskell.org/trac/ghc/ticket/3399 Christian Dan Rosén schrieb: Hello, I realized today that the type for deleteBy in Data.List is too restrictive. The code is: deleteBy:: (a - a - Bool) - a - [a] - [a] deleteBy _

[Haskell-cafe] Re: Distinct types in a list

2010-01-07 Thread Christian Maeder
You could cast your parser result a to Dynamic using Data.Dynamic.toDyn (and derive Typeable instances for all involved types). http://www.haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Data-Dynamic.html Using an existential types may be another alternative. Cheers Christian

  1   2   3   >