Skip to content

v0.96.0.2: Drop support for GHC 7, make Prelude imports explicit #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
/dist-newstyle/
/cabal.project.local
/.ghc.environment.*
/.stack-work/
/stack*.yaml.lock
*~

7 changes: 6 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
For versioning policy, see: http://pvp.haskell.org/faq
## 0.96.0.2 (2025-03-02)

- Drop support for GHC 7
- Make `Prelude` imports explicit, add `LANGUAGE NoImplicitPrelude`
- Make upper bounds of dependencies major-major (all are shipped with GHC)
- Tested with GHC 8.0 - 9.12.1

## 0.96.0.1 Revision 3 (2023-09-28)

Expand Down
2 changes: 0 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
This modile is under this "3 clause" BSD license:

Copyright (c) 2007, Christopher Kuklewicz
All rights reserved.

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[![Hackage version](https://img.shields.io/hackage/v/regex-posix.svg?label=Hackage&color=informational)](http://hackage.haskell.org/package/regex-posix)
[![Stackage Nightly](http://stackage.org/package/regex-posix/badge/nightly)](http://stackage.org/nightly/package/regex-posix)
[![Stackage LTS](http://stackage.org/package/regex-posix/badge/lts)](http://stackage.org/lts/package/regex-posix)
[![Haskell-CI](https://github.com/haskell-hvr/regex-posix/actions/workflows/haskell-ci.yml/badge.svg?branch=master&event=push)](https://github.com/haskell-hvr/regex-posix/actions/workflows/haskell-ci.yml)
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
regex-posix
===========

[Documentation](https://hackage.haskell.org/package/regex-posix/docs/Text-Regex-Posix.html) on hackage.
2 changes: 0 additions & 2 deletions Setup.hs

This file was deleted.

39 changes: 17 additions & 22 deletions regex-posix.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cabal-version: 1.12
cabal-version: 1.24
name: regex-posix
version: 0.96.0.1
x-revision: 3
version: 0.96.0.2

build-type: Simple
license: BSD3
Expand All @@ -19,8 +18,11 @@ description:
.
See also <https://wiki.haskell.org/Regular_expressions> for more information.

extra-source-files:
extra-doc-files:
README.md
ChangeLog.md

extra-source-files:
cbits/myfree.h

tested-with:
Expand All @@ -45,7 +47,7 @@ source-repository head
source-repository this
type: git
location: https://github.com/haskell-hvr/regex-base.git
tag: v0.96.0.1-r3
tag: v0.96.0.2

flag _regex-posix-clib
manual: False
Expand Down Expand Up @@ -73,32 +75,25 @@ library
-- Otherwise, use POSIX.2 regex implementation from @libc@.
-- However, Windows/msys2 doesn't provide a POSIX.2 regex impl in its @libc@.

default-language: Haskell2010
default-language:
Haskell2010
default-extensions:
NoImplicitPrelude
MultiParamTypeClasses
FunctionalDependencies
ForeignFunctionInterface
GeneralizedNewtypeDeriving
FlexibleContexts
TypeSynonymInstances
-- ^ for ghc 7.0, subsumed under FlexibleInstances later
FlexibleInstances

build-depends: regex-base == 0.94.*
, base >= 4.3 && < 5
, containers >= 0.4 && < 0.8
, bytestring >= 0.9 && < 0.13
, array >= 0.3 && < 0.6

if impl(ghc < 8)
build-depends: fail == 4.9.*

-- Warnings
build-depends:
regex-base == 0.94.*
, base >= 4.9 && < 5
, containers >= 0.5 && < 1
, bytestring >= 0.10 && < 1
, array >= 0.5 && < 1

ghc-options:
-Wall
-fno-warn-unused-imports

if impl(ghc >= 8)
ghc-options:
-Wcompat
-Wno-orphans
7 changes: 3 additions & 4 deletions src/Text/Regex/Posix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- Copyright : (c) Chris Kuklewicz 2006
-- License : BSD-3-Clause
--
-- Maintainer : [email protected], Andreas Abel
-- Maintainer : Andreas Abel
-- Stability : stable
-- Portability : non-portable (regex-base needs MPTC+FD)
--
Expand Down Expand Up @@ -55,8 +55,7 @@ module Text.Regex.Posix(getVersion_Text_Regex_Posix
-- ** Wrap, for '=~' and '=~~', types and constants
,module Text.Regex.Posix.Wrap) where

import Prelude hiding (fail)
import Control.Monad.Fail (MonadFail)
import Prelude ()

import Text.Regex.Posix.Wrap(Regex, CompOption(CompOption),
ExecOption(ExecOption), (=~), (=~~),
Expand All @@ -67,7 +66,7 @@ import Text.Regex.Posix.String()
import Text.Regex.Posix.Sequence()
import Text.Regex.Posix.ByteString()
import Text.Regex.Posix.ByteString.Lazy()
import Data.Version(Version(..))
import Data.Version(Version)
import Text.Regex.Base
import qualified Paths_regex_posix

Expand Down
13 changes: 10 additions & 3 deletions src/Text/Regex/Posix/ByteString.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Regex.Posix.ByteString
-- Copyright : (c) Chris Kuklewicz 2006
-- License : BSD-3-Clause
--
-- Maintainer : [email protected], Andreas Abel
-- Maintainer : Andreas Abel
-- Stability : stable
-- Portability : non-portable (regex-base needs MPTC+FD)
--
Expand Down Expand Up @@ -51,7 +50,15 @@ module Text.Regex.Posix.ByteString(
execNotEOL -- not at end of line
) where

import Prelude hiding (fail)
import Prelude
( Int, Integral, Num, (-), fromIntegral, pred
, Either(Left, Right), either
, Show(show)
, IO, (>>=), return
, Maybe(Nothing, Just)
, ($), (.), (==), (&&), otherwise, not
, (++), length, map
)
import Control.Monad.Fail (MonadFail(fail))

import Data.Array(Array,listArray)
Expand Down
14 changes: 11 additions & 3 deletions src/Text/Regex/Posix/ByteString/Lazy.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Regex.Posix.ByteString.Lazy
-- Copyright : (c) Chris Kuklewicz 2007
-- License : BSD-3-Clause
--
-- Maintainer : [email protected], Andreas Abel
-- Maintainer : Andreas Abel
-- Stability : stable
-- Portability : non-portable (regex-base needs MPTC+FD)
--
Expand Down Expand Up @@ -52,7 +51,16 @@ module Text.Regex.Posix.ByteString.Lazy(
execNotEOL -- not at end of line
) where

import Prelude hiding (fail)
import Prelude
( Int, fromIntegral
, Either(Left, Right), either
, Show(show)
, IO, (>>=), return
, Maybe(Nothing, Just)
, (.), ($), (==)
, (&&), not
, (++), map
)
import Control.Monad.Fail (MonadFail(fail))

import Data.Array(Array)
Expand Down
14 changes: 11 additions & 3 deletions src/Text/Regex/Posix/Sequence.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Regex.Posix.Sequence
-- Copyright : (c) Chris Kuklewicz 2006
-- License : BSD-3-Clause
--
-- Maintainer : [email protected], Andreas Abel
-- Maintainer : Andreas Abel
-- Stability : stable
-- Portability : non-portable (regex-base needs MPTC+FD)
--
Expand Down Expand Up @@ -48,7 +47,16 @@ module Text.Regex.Posix.Sequence(
execNotEOL -- not at end of line
) where

import Prelude hiding (fail)
import Prelude
( Char
, Int, (-), fromEnum, fromIntegral, pred
, Show(show)
, Either(Left, Right), either
, IO, (>>), (>>=), return
, Maybe(Nothing, Just)
, ($), (.), (==), otherwise
, (++), length, map
)
import Control.Monad.Fail (MonadFail(fail))

import Data.Array(listArray, Array)
Expand Down
16 changes: 13 additions & 3 deletions src/Text/Regex/Posix/String.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Regex.Posix.String
-- Copyright : (c) Chris Kuklewicz 2006
-- License : BSD-3-Clause
--
-- Maintainer : [email protected], Andreas Abel
-- Maintainer : Andreas Abel
-- Stability : stable
-- Portability : non-portable (regex-base needs MPTC+FD)
--
Expand Down Expand Up @@ -48,7 +47,18 @@ module Text.Regex.Posix.String(
execNotEOL -- not at end of line
) where

import Prelude hiding (fail)
import Prelude
( Int, String, IO
, Either(Left, Right), either
, Maybe(Nothing, Just)
, Show(show)
, fromIntegral, pred
, (.), ($), (==), otherwise
, (++), (-)
, (>>=), return
, length, map
)

import Control.Monad.Fail (MonadFail(fail))

import Data.Array(listArray, Array)
Expand Down
24 changes: 16 additions & 8 deletions src/Text/Regex/Posix/Wrap.hsc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{-# OPTIONS_GHC -Wall -fno-warn-unused-imports #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}

-----------------------------------------------------------------------------
-- |
-- Module : Text.Regex.Posix.Wrap
-- Copyright : (c) Chris Kuklewicz 2006,2007,2008 derived from (c) The University of Glasgow 2002
-- Identifier : BSD-3-Clause
--
-- Maintainer : [email protected], Andreas Abel
-- Maintainer : Andreas Abel
-- Stability : stable
-- Portability : non-portable (regex-base needs MPTC+FD)
--
Expand Down Expand Up @@ -97,7 +98,18 @@ module Text.Regex.Posix.Wrap(

#include "myfree.h"

import Prelude hiding (fail)
import Prelude
( Bool(True, False), otherwise
, Either(Left, Right)
, Eq, (==), (/=), (>=)
, IO, return, mapM
, Int, Num, (+), (*), (-), fromIntegral, pred, succ, toEnum
, Maybe(Nothing, Just)
, Show(show)
, String
, ($), (.), seq, undefined
, (++), iterate, length, map, take
)
import Control.Monad.Fail (MonadFail)

import Control.Monad(liftM)
Expand All @@ -106,15 +118,11 @@ import Data.Bits(Bits(..))
import Data.Int(Int32,Int64) -- need whatever RegeOffset or #regoff_t type will be
import Data.Word(Word32,Word64) -- need whatever RegeOffset or #regoff_t type will be
import Foreign(Ptr, FunPtr, nullPtr, newForeignPtr,
addForeignPtrFinalizer, Storable(peekByteOff), allocaArray,
Storable(peekByteOff), allocaArray,
allocaBytes, withForeignPtr,ForeignPtr,plusPtr,peekElemOff)
import Foreign.Marshal.Alloc(mallocBytes)
import Foreign.C(CChar)
#if __GLASGOW_HASKELL__ >= 703
import Foreign.C(CSize(CSize),CInt(CInt))
#else
import Foreign.C(CSize,CInt)
#endif
import Foreign.C.String(peekCAString, CString)
import Text.Regex.Base.RegexLike(RegexOptions(..),RegexMaker(..),RegexContext(..),MatchArray)
-- deprecated: import qualified System.IO.Error as IOERROR(try)
Expand Down