packages feed

matchers 0.22.0.0 → 0.24.0.0

raw patch · 6 files changed

+19/−22 lines, 6 filesdep ~prednotePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: prednote

API changes (from Hackage documentation)

- Matchers.Types: Insensitive :: CaseSensitive
- Matchers.Types: Sensitive :: CaseSensitive
- Matchers.Types: data CaseSensitive
- Matchers.Types: instance Eq CaseSensitive
- Matchers.Types: instance Ord CaseSensitive
- Matchers.Types: instance Show CaseSensitive
+ Matchers.Pcre: Insensitive :: CaseSensitive
+ Matchers.Pcre: Sensitive :: CaseSensitive
+ Matchers.Pcre: data CaseSensitive
+ Matchers.Pcre.Base: Insensitive :: CaseSensitive
+ Matchers.Pcre.Base: Sensitive :: CaseSensitive
+ Matchers.Pcre.Base: data CaseSensitive
+ Matchers.Pcre.Base: instance Eq CaseSensitive
+ Matchers.Pcre.Base: instance Ord CaseSensitive
+ Matchers.Pcre.Base: instance Show CaseSensitive

Files

README.md view
@@ -8,6 +8,8 @@ [Penny](http://www.github.com/massysett/penny) so it doesn't have much of a stable API. +It uses the pcre C library, so make sure you have that installed.+ ## Test results  [![Build Status](https://travis-ci.org/massysett/matchers.svg?branch=master)](https://travis-ci.org/massysett/matchers)
lib/Matchers.hs view
@@ -9,7 +9,6 @@ import Data.Text (Text, pack, toCaseFold, isInfixOf) import Matchers.Pcre as PCRE import qualified Prednote as R-import Matchers.Types import Data.Monoid  pcre@@ -19,14 +18,13 @@   -> Either String (R.Pred Text) pcre cs txt = fmap f $ compile cs txt   where-    f pc = R.predicate st dyn pd+    f pc = R.predicate cond pd       where-        st = "matches the PCRE regular expression "-          <> txt <> " - " <> s+        cond = "matches the PCRE regular expression "+          <> (pack . show $ txt) <> ", " <> s         s = case cs of           Sensitive -> "case sensitive"           Insensitive -> "case insensitive"-        dyn x = "text " <> pack (show x) <> " - " <> st         pd x = case exec pc x of           Nothing -> False           Just b -> b@@ -51,18 +49,17 @@ txtMatch   :: (Text -> Text -> Bool)   -> Text-  -- ^ Static label+  -- ^ Condition description   -> CaseSensitive   -> Text   -- ^ Pattern   -> R.Pred Text-txtMatch f lbl c p = R.predicate st dyn pd+txtMatch f lbl c p = R.predicate cond pd   where-    st = lbl <> " - " <> cs+    cond = lbl <> ", " <> cs     (cs, flipCase) = case c of       Sensitive -> ("case sensitive", id)       Insensitive -> ("case insensitive", toCaseFold)-    dyn txt = "text " <> pack (show txt) <> " - " <> st     pd t = f pat txt       where         txt = flipCase t
lib/Matchers/Pcre.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE Trustworthy #-} module Matchers.Pcre-  ( B.PCRE+  ( B.CaseSensitive(..)+  , B.PCRE   , compile   , exec   ) where@@ -8,10 +9,9 @@ import qualified Matchers.Pcre.Base as B import qualified Data.Text as X import System.IO.Unsafe (unsafePerformIO)-import Matchers.Types  compile-  :: CaseSensitive+  :: B.CaseSensitive   -> X.Text   -> Either String B.PCRE compile cl x = unsafePerformIO $ B.compile cl x
lib/Matchers/Pcre/Base.hsc view
@@ -1,7 +1,8 @@ {-# LANGUAGE ForeignFunctionInterface, EmptyDataDecls #-}  module Matchers.Pcre.Base-  ( PCRE+  ( CaseSensitive(..)+  , PCRE   , compile   , exec   ) where@@ -15,10 +16,13 @@ import Data.ByteString import Data.Text import Data.Text.Encoding-import Matchers.Types + #include <pcre.h> #include <stdlib.h>++data CaseSensitive = Sensitive | Insensitive+  deriving (Eq, Ord, Show)  caseless :: CInt caseless = #const PCRE_CASELESS
− lib/Matchers/Types.hs
@@ -1,5 +0,0 @@-module Matchers.Types where--data CaseSensitive = Sensitive | Insensitive-  deriving (Eq, Ord, Show)-
matchers.cabal view
@@ -1,5 +1,5 @@ Name: matchers-Version: 0.22.0.0+Version: 0.24.0.0 Cabal-version: >=1.8 Build-Type: Simple License: BSD3@@ -29,14 +29,13 @@           base >=4.5.0.0 && < 5         , bytestring >=0.9.2.1 && < 0.11         , text >=0.11.2.0 && < 1.3-        , prednote >= 0.26.0.0 && < 0.27+        , prednote >= 0.28.0.0 && < 0.29       Exposed-modules:         Matchers       , Matchers.Pcre       , Matchers.Pcre.Base-      , Matchers.Types     extra-libraries: pcre