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 <[email protected]> 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 > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
