[Haskell-cafe] Regex multiple matches

2010-07-20 Thread Omari Norman
Hi, How do I use Text.Regex.PCRE to get information on multiple matches? For instance, in ghci I get this error message: Prelude Text.Regex.PCRE> "foo" =~ "o" :: [(Int,Int)] :1:0: No instance for (RegexContext Regex [Char] [(Int, Int)]) arising from a use of `=~' at :1:0-11 Possibl

Re: [Haskell-cafe] Regex multiple matches

2010-07-20 Thread Omari Norman
> How do I use Text.Regex.PCRE to get information on multiple matches? For > instance, in ghci I get this error message: > > Prelude Text.Regex.PCRE> "foo" =~ "o" :: [(Int,Int)] Solved; do getAllMatches ("foo" =~ "o") :: [(Int, Int)] ___ Haskell-Cafe

[Haskell-cafe] Why is toRational a method of Real?

2010-08-04 Thread Omari Norman
Why is toRational a method of Real? I thought that real numbers need not be rational, such as the square root of two. Wouldn't it make more sense to have some sort of Rational typeclass with this method? Thanks. --Omari ___ Haskell-Cafe mailing list Hask

[Haskell-cafe] <> error message

2013-06-21 Thread Omari Norman
I compiled some code with GHC 7.6.3 that produces a simple error at runtime myProgramName: <> At which point the program exits with code 1. Is there documentation for this error anywhere? Does it mean I have some infinite loop in my code somewhere? If so, does GHC catch all infinite loops? I hav

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-08-31 Thread Omari Norman
On Thu, Aug 29, 2013 at 9:30 PM, Mateusz Kowalczyk wrote: > Greetings café, > > Perhaps some saddening news for Markdown fans out there. As you might > remember, there was a fair amount of push for having Markdown as an > alternate syntax for Haddock. > > This is a little off-topic, but the Haddoc

[Haskell-cafe] [ANNOUNCE] Penny - double-entry accounting

2013-10-02 Thread Omari Norman
I'm pleased to make the first public announcement of the availability of Penny, a double-entry command-line accounting system. Penny is inspired by Ledger, an excellent program in its own right. Ledger's websites and sales pitches are much better developed than those for Penny, so first take a loo

[Haskell-cafe] Text.Regex.Base throws exceptions with makeRegexOptsM

2011-12-29 Thread Omari Norman
Hi folks, I'm using Text.Regex.Base with the TDFA and PCRE backends. I want to compile regular expressions first and make sure the patterns were actually valid, so I used makeRegexOptsM, which indicates a bad regular expression by calling fail. That allows you to use makeRegexOptsM with Maybe or w

Re: [Haskell-cafe] Text.Regex.Base throws exceptions with makeRegexOptsM

2011-12-29 Thread Omari Norman
On Fri, Dec 30, 2011 at 01:24:02AM +0100, Daniel Fischer wrote: > For Either, there used to be > > instance Error e => Monad (Either e) where > ... > fail s = Left (strMsg s) > > in mtl's Control.Monad.error, and all was fine if one used the regex > functions with e.g. (Either String) as

Re: [Haskell-cafe] [Haskell] ANNOUNCE multiarg - parser combinators for command line parsing

2012-01-30 Thread Omari Norman
On Mon, Jan 30, 2012 at 03:19:47PM +0100, Henning Thielemann wrote: > > On Sun, 29 Jan 2012, Simon Meier wrote: > > >I'm currently using Neil Mitchell's cmdargs package [1]. How does your > >package compare to that? > > Last time I checked cmdargs it was not referential transparent. Is > multiar

[Haskell-cafe] Impact of "try" on Parsec performance

2012-03-02 Thread Omari Norman
The Parsec documentation says that Parsec performs best on predictive grammars, and Parsec does not backtrack by default to improve performance (though this also improves error messages). On the other hand, I notice that attoparsec and polyparse backtrack by default, and attoparsec claims to be fa

[Haskell-cafe] Alex character sets

2012-03-24 Thread Omari Norman
I'm wrinting (or at least, trying to write) an Alex lexer. Say I want to group character ranges together and specify that I want a character that is *not* in any of those ranges. Example --- { module Main where } %wrapper "posn-bytestring" $lowAscii = \x00-\x1f -- unprintable stuff $lowSymbol

Re: [Haskell-cafe] Alex character sets

2012-03-24 Thread Omari Norman
OK, it turns out that having [^\x00] as a character range gives me the error with pred. [\x00] works fine; [^\x00] gives the error message. On Sat, Mar 24, 2012 at 6:33 PM, Omari Norman wrote: > I'm wrinting (or at least, trying to write) an Alex lexer. Say I want to > group chara

[Haskell-cafe] cabal equivalent to "make -k"?

2012-07-06 Thread Omari Norman
When using make (or, at least, GNU make) the "-k" option keeps going as far as possible after a compilation error. It's handy during developing--for instance, "I know half of my code is busted, but I just want to see if this file compiles." Is there a similar way to do this with cabal? Thanks. --Om

[Haskell-cafe] Safe Haskell safe-inferred status

2012-12-08 Thread Omari Norman
Is there a way to determine whether a module has been marked safe by GHC for purposes of Safe Haskell? The GHC 7.4 docs say that if I compile a module and I don't use the -XSafe or -XTrustworthy flag, GHC will automatically figure out whether the module would have compiled with -XSafe and, if so,

[Haskell-cafe] [ANNOUNCE] rainbow - print colored text on UNIX-like systems

2013-06-09 Thread Omari Norman
Hi all, rainbow is a simple package to help you print colored text on UNIX-like systems. It's different from packages like terminfo (upon which it is based) and ansi-terminal in two ways. First, rainbow assumes you print text one "chunk" at a time. The properties of the terminal are reset with eve

[Haskell-cafe] Haddock docs don't list instances

2011-01-06 Thread Omari Norman
Web versions of Haddock documentation, even this old one, list a class's instances. http://www.haskell.org/ghc/docs/6.2.2/html/libraries/base/Prelude.html#5 My Haddock documentation does not have any class instances at all. This is true both of the documentation that comes with my Linux system (I