Commit 00dd731b authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Add intentional support for `SafeHaskell`

This is the first version whose `SafeHaskell` properties have become
an intentional part of the API contract; previous versions were merely
accidentally safe-inferred (or not depending on various factors; in
other words, this was a fragile property). If you rely on
`SafeHaskell` to consider module imports from `parsec` *safe*, this is
the first version of `parsec` which actually guarantees a well-defined
state.

Support for GHC 7.0, GHC 7.2, and GHC 7.4.1 has been dropped,
consequently the support window starts with GHC 7.4.2.

This addresses #88
parent d7c5d337
......@@ -26,12 +26,6 @@ before_cache:
matrix:
include:
- compiler: "ghc-7.0.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.0.4], sources: [hvr-ghc]}}
- compiler: "ghc-7.2.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.2.2], sources: [hvr-ghc]}}
- compiler: "ghc-7.4.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.4.2], sources: [hvr-ghc]}}
......
### 3.1.13.0
- Add official support for [`SafeHaskell`](http://downloads.haskell.org/~ghc/latest/docs/html/users_guide/safe_haskell.html)
**NOTE**: This is the first version whose `SafeHaskell` properties
have become an intentional part of the API contract; previous
versions were merely accidentally safe-inferred (or not depending
on various factors; in other words, this was a fragile
property). If you rely on `SafeHaskell` to consider module imports
from `parsec` *safe*, this is the first version of `parsec` which
actually guarantees a well-defined state; you can declare this
requirement by either specifying
build-depends: parsec >= 3.1.13.0 && < 3.2
or, starting with `cabal-version:2.0`, via
build-depends: parsec ^>= 3.1.13.0
- Drop support for GHC 7.0, GHC 7.2, and GHC 7.4.1; support window
starts with GHC 7.4.2.
### 3.1.12.0
- Support limited to GHC 7.0 & GHC 7.2 only
- Add `MonadFail` instance for `ParsecT`
- Add `Semigroup`/`Monoid` instances for `ParsecT` (#80,#82)
- Fix space leak in Applicative/Monad interface (#37)
......
cabal-version: >= 1.10
cabal-version: 1.12
name: parsec
version: 3.1.12.0
version: 3.1.13.0
synopsis: Monadic parser combinators
description: Parsec is designed from scratch as an industrial-strength parser
......@@ -26,7 +26,7 @@ bug-reports: https://github.com/haskell/parsec/issues
category: Parsing
build-type: Simple
tested-with: GHC ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2 || ==7.2.2 || ==7.0.4
tested-with: GHC ==8.4.1 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2
extra-source-files: ChangeLog.md, README.md
......@@ -64,10 +64,10 @@ library
Text.ParserCombinators.Parsec.Token
build-depends:
base >= 4.3 && < 5,
mtl >= 1.1 && < 2.3,
bytestring >= 0.9.1 && < 0.11,
text >= 0.2 && < 1.3
base >= 4.5.1 && < 4.12,
mtl >= 1.1.1 && < 2.3,
bytestring >= 0.9.2.1 && < 0.11,
text >= 0.11.3 && < 1.3
default-language: Haskell2010
other-extensions:
......@@ -80,15 +80,19 @@ library
MultiParamTypeClasses
PolymorphicComponents
StandaloneDeriving
Safe
Trustworthy
UndecidableInstances
ghc-options: -Wall
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances
ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wno-trustworthy-safe
else
-- provide/emulate `Control.Monad.Fail` and `Semigroup` API for pre-GHC8
build-depends: fail == 4.9.*, semigroups == 0.18.*
if impl(ghc >= 7.10)
ghc-options: -fno-warn-trustworthy-safe
test-suite parsec.
type: exitcode-stdio-1.0
......
{-# LANGUAGE Safe #-}
{-|
Module : Text.Parsec
Copyright : (c) Daan Leijen 1999-2001, (c) Paolo Martini 2007
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.ByteString
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.ByteString.Lazy
-- Copyright : (c) Paolo Martini 2007
-- License : BSD-style (see the LICENSE file)
--
--
-- Maintainer : derek.a.elkins@gmail.com
-- Stability : provisional
-- Portability : portable
......
{-# LANGUAGE CPP, FlexibleContexts #-}
{-# LANGUAGE CPP, FlexibleContexts, Safe #-}
-----------------------------------------------------------------------------
-- |
......
-- due to Debug.Trace
{-# LANGUAGE Trustworthy #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.Combinator
......
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
......
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.Language
......
......@@ -3,6 +3,7 @@
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
......
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
......
......@@ -6,6 +6,7 @@
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolymorphicComponents #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.String
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.String
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.Parsec.String
......
......@@ -2,6 +2,7 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE PolymorphicComponents #-}
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec
-- Copyright : (c) Paolo Martini 2007
-- License : BSD-style (see the LICENSE file)
--
--
-- Maintainer : derek.a.elkins@gmail.com
-- Stability : provisional
-- Portability : portable
--
--
-- Parsec compatibility module
--
--
-----------------------------------------------------------------------------
module Text.ParserCombinators.Parsec
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Char
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Combinator
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Error
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Expr
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Language
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Perm
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Pos
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Prim
......
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Text.ParserCombinators.Parsec.Token
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment