void 0.7 → 0.7.4
raw patch · 8 files changed
Files
- .gitignore +19/−0
- .travis.yml +0/−1
- CHANGELOG.markdown +18/−0
- LICENSE +1/−1
- README.markdown +1/−1
- src-old/Data/Void.hs +0/−111
- src/Data/Void/Unsafe.hs +4/−3
- void.cabal +17/−22
.gitignore view
@@ -13,3 +13,22 @@ tags wiki wip+dist-newstyle/+.stack-work/+cabal-dev+*.chi+*.chs.h+*.dyn_o+*.dyn_hi+.hpc+.hsenv+.cabal-sandbox/+cabal.sandbox.config+*.prof+*.aux+*.hp+*.eventlog+cabal.project.local+cabal.project.local~+.HTF/+.ghc.environment.*
− .travis.yml
@@ -1,1 +0,0 @@-language: haskell
CHANGELOG.markdown view
@@ -1,3 +1,21 @@+0.7.4 [2025.12.08]+------------------+* Drop support for pre-8.0 versions of GHC.++0.7.3 [2019.05.10]+------------------+* Backport the `Lift Void` instance introduced in `template-haskell-2.15.0.0`.++0.7.2+-----+* Only depend on `deepseq`, `hashable`, and `semigroups` if using GHC 7.8 or earlier.+* Cleaned up spurious "redundant constraint" warnings on GHC 8+++0.7.1+-----+* Support `semigroups` 0.17 on older GHCs+* Backported `NFData`'s `semigroup` instance to older GHCs.+ 0.7 --- * adapt to `Data.Void` being moved into `base-4.8`
LICENSE view
@@ -1,4 +1,4 @@-Copyright 2013 Edward Kmett+Copyright 2015 Edward Kmett All rights reserved.
README.markdown view
@@ -1,7 +1,7 @@ void ==== -[](http://travis-ci.org/ekmett/void)+[](https://hackage.haskell.org/package/void) [](https://github.com/ekmett/void/actions?query=workflow%3AHaskell-CI) This package provides a canonical 'uninhabited' data type for Haskell. This arises in a surprisingly wide array of situations in practice.
− src-old/Data/Void.hs
@@ -1,111 +0,0 @@-{-# LANGUAGE CPP #-}-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702-{-# LANGUAGE Trustworthy #-}-#endif--#ifdef LANGUAGE_DeriveDataTypeable-{-# LANGUAGE DeriveDataTypeable #-}-#endif--#ifdef LANGUAGE_DeriveGeneric-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE StandaloneDeriving #-}-#endif--#ifndef MIN_VERSION_base-#define MIN_VERSION_base(x,y,z) 1-#endif--------------------------------------------------------------------------------- |--- Copyright : (C) 2008-2013 Edward Kmett--- License : BSD-style (see the file LICENSE)------ Maintainer : Edward Kmett <ekmett@gmail.com>--- Stability : provisional--- Portability : portable---------------------------------------------------------------------------------module Data.Void- ( Void- , absurd- , vacuous- , vacuousM- ) where--import Control.Monad (liftM)-import Data.Ix-import Data.Hashable-import Data.Semigroup (Semigroup(..))--#ifdef LANGUAGE_DeriveDataTypeable-import Data.Data-#endif--#ifdef LANGUAGE_DeriveGeneric-import GHC.Generics-#endif--#if MIN_VERSION_base(4,0,0)-import Control.Exception-#endif---- | A logically uninhabited data type.-#if __GLASGOW_HASKELL__ < 700-data Void = Void !Void-#else-newtype Void = Void Void-#endif-#ifdef LANGUAGE_DeriveDataTypeable- deriving (Data, Typeable)-#endif--#ifdef LANGUAGE_DeriveGeneric-deriving instance Generic Void-#endif--instance Eq Void where- _ == _ = True--instance Hashable Void where- hashWithSalt _ = absurd--instance Ord Void where- compare _ _ = EQ--instance Show Void where- showsPrec _ = absurd---- | Reading a 'Void' value is always a parse error, considering 'Void' as--- a data type with no constructors.-instance Read Void where- readsPrec _ _ = []---- | Since 'Void' values logically don't exist, this witnesses the logical--- reasoning tool of \"ex falso quodlibet\".-absurd :: Void -> a-absurd a = a `seq` spin a where- spin (Void b) = spin b---- | If 'Void' is uninhabited then any 'Functor' that holds only values of type 'Void'--- is holding no values.-vacuous :: Functor f => f Void -> f a-vacuous = fmap absurd---- | If 'Void' is uninhabited then any 'Monad' that holds values of type 'Void'--- is holding no values.-vacuousM :: Monad m => m Void -> m a-vacuousM = liftM absurd--instance Semigroup Void where- a <> _ = a- times1p _ a = a--instance Ix Void where- range _ = []- index _ = absurd- inRange _ = absurd- rangeSize _ = 0--#if MIN_VERSION_base(4,0,0)-instance Exception Void-#endif
src/Data/Void/Unsafe.hs view
@@ -1,11 +1,12 @@ {-# LANGUAGE CPP #-}-#if !defined(SAFE) && defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704+#if !defined(SAFE) && defined(__GLASGOW_HASKELL__) #define UNSAFE {-# LANGUAGE Unsafe #-} #endif+{-# OPTIONS_GHC -Wno-redundant-constraints #-} -- they aren't redundant! ----------------------------------------------------------------------------- -- |--- Copyright : (C) 2008-2013 Edward Kmett+-- Copyright : (C) 2008-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett <ekmett@gmail.com>@@ -24,7 +25,7 @@ import Unsafe.Coerce #endif --- | If 'Void' is uninhabited than any 'Functor' that holds only values of the type 'Void'+-- | If 'Void' is uninhabited then any 'Functor' that holds only values of the type 'Void' -- is holding no values. -- -- This is only safe for valid functors that do not perform GADT-like analysis on the argument.
void.cabal view
@@ -1,6 +1,6 @@ name: void category: Data Structures-version: 0.7+version: 0.7.4 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -9,22 +9,34 @@ stability: portable homepage: http://github.com/ekmett/void bug-reports: http://github.com/ekmett/void/issues-copyright: Copyright (C) 2008-2013 Edward A. Kmett+copyright: Copyright (C) 2008-2015 Edward A. Kmett synopsis: A Haskell 98 logically uninhabited data type description: A Haskell 98 logically uninhabited data type, used to indicate that a given term should not exist. build-type: Simple+tested-with: GHC==9.12.2+ , GHC==9.10.3+ , GHC==9.8.4+ , GHC==9.6.6+ , GHC==9.4.8+ , GHC==9.2.8+ , GHC==9.0.2+ , GHC==8.10.7+ , GHC==8.8.4+ , GHC==8.6.5+ , GHC==8.4.4+ , GHC==8.2.2+ , GHC==8.0.2 extra-source-files: .ghci .gitignore- .travis.yml .vim.custom CHANGELOG.markdown README.markdown source-repository head type: git- location: git://github.com/ekmett/void.git+ location: https://github.com/ekmett/void.git flag safe manual: True@@ -36,26 +48,9 @@ exposed-modules: Data.Void.Unsafe - if !impl(ghc>=7.9)- hs-source-dirs: src-old- exposed-modules: Data.Void-- build-depends:- base >= 3 && < 10,- hashable >= 1.1,- semigroups >= 0.8.2+ build-depends: base >= 3 && < 10 ghc-options: -Wall if flag(safe) cpp-options: -DSAFE-- if impl(ghc)- other-extensions: DeriveDataTypeable- cpp-options: -DLANGUAGE_DeriveDataTypeable-- if impl(ghc >= 7.2)- other-extensions: StandaloneDeriving- -- other-extensions: DeriveGeneric isn't known to cabal yet- cpp-options: -DLANGUAGE_DeriveGeneric- build-depends: ghc-prim