valpackett / pcre-heavy

A Haskell regular expressions library that doesn't suck | now on https://codeberg.org/valpackett/pcre-heavy
https://codeberg.org/valpackett/pcre-heavy
The Unlicense
51 stars 6 forks source link

First example in the REAMDE has regexp syntax error #12

Closed MaxGabriel closed 6 years ago

MaxGabriel commented 6 years ago

Hi, haven't used this library before so perhaps I'm doing something wrong, but I copied the first example from the README and got htis:

ghci> "https://unrelenting.technology" =~ [re|^http.*|]

<interactive>:13:38: error:
    A section must be enclosed in parentheses thus: (re |^ http .*|)

I dumped some information about my system (package versions, OS X version, etc.) here: https://gist.github.com/MaxGabriel/cb80301f9061243a095b8e2edafa31ec, if that's necessary to debug. Notably I'm using LTS haskell 9.14 (which has pcre-heavy 1.0.0.2)

valpackett commented 6 years ago

Hi. That's not a regexp syntax error, that's GHC complaining about the whole [re|…|] thing.

Do you have QuasiQuotes on? The README mentions {-# LANGUAGE QuasiQuotes, FlexibleContexts #-}. In GHCi that would be :set -XQuasiQuotes -XFlexibleContexts.

MaxGabriel commented 6 years ago

Oh @myfreeweb mybad, I thought it was in my .ghci but I was mistaken. Sorry about that!

Thanks for your help :)