[Haskell-cafe] performance question

MigMit miguelimo38 at yandex.ru
Wed Feb 13 18:34:20 CET 2013


Well, this runtime errors are actually type errors. Regexps are actually a DSL, which is not embedded in Haskell. But it could be. Strings won't work for that, but something like that would:

filter (match $ "a" <> many anyChar <> ".txt") filenames

and this certainly can be produced by TH like that:

filter (match $(regexp "a.*\\.txt")) filenames

On Feb 13, 2013, at 8:43 PM, Nicolas Trangez <nicolas at incubaid.com> wrote:

> On Wed, 2013-02-13 at 08:39 -0800, David Thomas wrote:
>> One way in which regexps are "foreign to Haskell-think" is that, if
>> they
>> break, they generally break at run-time.  This could be ameliorated
>> with
>> template haskell
> 
> Care to elaborate on the "ameliorate using TH" part? I figure regexes
> would be mostly used to parse some runtime-provided string, so how could
> compile-TH provide any help?
> 
> Nicolas
> 
> 
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe




More information about the Haskell-Cafe mailing list