Text interface for regex-tdfa
#1regex-tdfa-text doesn't build with GHC 7.10
Error:
Text/Regex/TDFA/Text/Lazy.hs:77:9:
Non type-variable argument
in the constraint: Data.Array.Base.IArray a (Int, Int)
(Use FlexibleContexts to permit this)
When checking that ‘go’ has the inferred type
go :: forall t (a :: * -> * -> *) i.
(Functor (a i), Num i, GHC.Arr.Ix i,
Data.Array.Base.IArray a (Int, Int), Extract t) =>
Int -> t -> [a i (Int, Int)] -> [a i (t, (Int, Int))]
In the expression:
let
go i _ _ | i `seq` False = undefined
go _i _t [] = []
go i t (x : xs)
= let ... in fmap trans x : seq t' (go (off0 + len0) t' xs)
in go 0 source (matchAll regex source)
In an equation for ‘matchAllText’:
matchAllText regex source
= let
go i _ _ | i `seq` False = undefined
go _i _t [] = ...
go i t (x : xs) = ...
in go 0 source (matchAll regex source)
Fix:
{-# LANGUAGE FlexibleContexts #-}
I've attached a quick dpatch
Issue BundleI believe a better fix would be to add the following type signature at Text/Regex/TDFA/Text/Lazy.hs:78.
go :: Int -> L.Text -> [MatchArray] -> [MatchText L.Text]
To read more about my quest to stop people from blindly adding FlexibleContexts without understanding what's going on, read this:
https://www.reddit.com/r/haskell/comments/2zu5r9/on_adding_flexiblecontexts_to_please_ghc_710/
When is this going to be fixed for Hackage?
+1, when is this going to hit Hackage?
My +1 for Hackage too.