Webrexp 1.1.1 → 1.1.2
raw patch · 2 files changed
+30/−1 lines, 2 files
Files
- Text/Webrexp/IOMock.hs +19/−0
- Webrexp.cabal +11/−1
+ Text/Webrexp/IOMock.hs view
@@ -0,0 +1,19 @@+{-# LANGUAGE FlexibleInstances #-} +module Text.Webrexp.IOMock ( IOMockable( .. ) ) where + +import Control.Monad.ST +import Control.Applicative( (<$>) ) + +-- | Mocking IO, to let the software use IO actions normally, +-- and get back Nothing in case of non-authorization (like if +-- we want the code to stay in ST to be embeddable). Effectively +-- implement a form of sandboxing. +class IOMockable m where + performIO :: IO a -> m (Maybe a) + +instance IOMockable IO where + performIO a = Just <$> a + +instance IOMockable (ST s) where + performIO _ = return Nothing +
Webrexp.cabal view
@@ -1,5 +1,5 @@ Name: Webrexp -Version: 1.1.1 +Version: 1.1.2 Synopsis: Regexp-like engine to scrap web data Build-Type: Simple License: BSD3 @@ -9,6 +9,15 @@ Author: Vincent Berthoux Maintainer: Vincent Berthoux (twinside@gmail.com) +Source-Repository head + Type: git + Location: git@github.com:Twinside/Webrexp.git + +Source-Repository this + Type: git + Location: git@github.com:Twinside/Webrexp.git + Tag: v1.1.2 + Flag optimize Description: turn on optimisation Default: False @@ -59,6 +68,7 @@ Text.Webrexp.Eval.ActionFunc Text.Webrexp.HaXmlNode Text.Webrexp.HxtNode + Text.Webrexp.IOMock Text.Webrexp.JsonNode Text.Webrexp.ProjectByteString Text.Webrexp.Remote.MimeTypes