Haskell: `regex-pcre` not found

Hi there, I’m just moving over a discussion (linked below) from Discord per @neenjaw 's suggestion.

Basically, the regex-pcre library isn’t available to the test runner (the hypothesis being that package isn’t included in the runner’s underlying image) – this causes errors like:

Now, I’m not sure it’s in the spirit of the Haskell learning track to include this package since it could be a “crutch,” functionality that is relied upon and precludes learning how to actually write Haskell code to perform the given task (like I’ve done in the above exercise :upside_down_face:), but that probably warrants a more philosophical (if not pedagogical) exchange!

{ X-link to the Discord discussion }

@MatthijsBlom Is this a commonly used package?

I don’t know, but in any case the regex-tdfa package should be available:

Going by Hackage, regex-tdfa is more popular than regex-pcre.

1 Like

Hey there!
First of all, sorry for necroposting :smiley: I found this thread while working on the 48in24 challenge, since I (also) wanted to solve the acronym exercise using regexes.

regex-tdfa is, as already said, more popular than regex-pcre, but the two libraries use different regex styles and have different limitations. regex-tdfa, while being faster thatn regex-pcre, does not allow positive/negative lookarounds, which might come useful in some circumstances. I got two distinct solutions with both libraries for the aforementioned exercise (one of which of course is not building on the test runner) and I feel that the pcre one is way more compact and “similar” to the other languages.

WDYT? Thanks in advance!