void-0.7.3/0000755000000000000000000000000007346545000010653 5ustar0000000000000000void-0.7.3/.ghci0000755000000000000000000000012507346545000011567 0ustar0000000000000000:set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h void-0.7.3/.gitignore0000755000000000000000000000044507346545000012651 0ustar0000000000000000*# *.hi *.o *~ .*.swo .*.swp .swp .DS_Store TAGS _darcs dist docs 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.* void-0.7.3/.travis.yml0000755000000000000000000002062507346545000012774 0ustar0000000000000000# This Travis job script has been generated by a script via # # haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci' 'cabal.project' # # For more information, see https://github.com/haskell-CI/haskell-ci # # version: 0.3.20190425 # language: c dist: xenial git: # whether to recursively clone submodules submodules: false notifications: irc: channels: - irc.freenode.org#haskell-lens skip_join: true template: - "\"\\x0313void\\x03/\\x0306%{branch}\\x03 \\x0314%{commit}\\x03 %{build_url} %{message}\"" cache: directories: - $HOME/.cabal/packages - $HOME/.cabal/store before_cache: - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log # remove files that are regenerated by 'cabal update' - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.* - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx - rm -rfv $CABALHOME/packages/head.hackage matrix: include: - compiler: ghc-8.8.1 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.8.1","cabal-install-3.0"]}} env: GHCHEAD=true - compiler: ghc-8.6.5 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.5","cabal-install-2.4"]}} - compiler: ghc-8.4.4 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}} - compiler: ghc-8.2.2 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}} - compiler: ghc-8.0.2 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}} - compiler: ghc-7.10.3 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.10.3","cabal-install-2.4"]}} - compiler: ghc-7.8.4 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.8.4","cabal-install-2.4"]}} - compiler: ghc-7.6.3 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.6.3","cabal-install-2.4"]}} - compiler: ghc-7.4.2 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.4.2","cabal-install-2.4"]}} - compiler: ghc-7.2.2 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.2.2","cabal-install-2.4"]}} - compiler: ghc-7.0.4 addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-7.0.4","cabal-install-2.4"]}} - compiler: ghc-head addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-head","cabal-install-head"]}} env: GHCHEAD=true allow_failures: - compiler: ghc-head - compiler: ghc-8.8.1 before_install: - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//') - HCPKG="$HC-pkg" - unset CC - CABAL=/opt/ghc/bin/cabal - CABALHOME=$HOME/.cabal - export PATH="$CABALHOME/bin:$PATH" - TOP=$(pwd) - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') )) - echo $HCNUMVER - CABAL="$CABAL -vnormal+nowrap+markoutput" - set -o pipefail - | echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk echo 'BEGIN { state = "output"; }' >> .colorful.awk echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk echo ' if (state == "cabal") {' >> .colorful.awk echo ' print blue($0)' >> .colorful.awk echo ' } else {' >> .colorful.awk echo ' print $0' >> .colorful.awk echo ' }' >> .colorful.awk echo '}' >> .colorful.awk - cat .colorful.awk - | color_cabal_output () { awk -f $TOP/.colorful.awk } - echo text | color_cabal_output install: - ${CABAL} --version - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]" - TEST=--enable-tests - BENCH=--enable-benchmarks - GHCHEAD=${GHCHEAD-false} - rm -f $CABALHOME/config - | echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config echo "remote-build-reporting: anonymous" >> $CABALHOME/config echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config echo "world-file: $CABALHOME/world" >> $CABALHOME/config echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config echo "installdir: $CABALHOME/bin" >> $CABALHOME/config echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config echo "store-dir: $CABALHOME/store" >> $CABALHOME/config echo "install-dirs user" >> $CABALHOME/config echo " prefix: $CABALHOME" >> $CABALHOME/config echo "repository hackage.haskell.org" >> $CABALHOME/config echo " url: http://hackage.haskell.org/" >> $CABALHOME/config - | if $GHCHEAD; then echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1/g')" >> $CABALHOME/config echo "repository head.hackage" >> $CABALHOME/config echo " url: http://head.hackage.haskell.org/" >> $CABALHOME/config echo " secure: True" >> $CABALHOME/config echo " root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740" >> $CABALHOME/config echo " 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb" >> $CABALHOME/config echo " 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e" >> $CABALHOME/config echo " key-threshold: 3" >> $CABALHOME/config fi - cat $CABALHOME/config - rm -fv cabal.project cabal.project.local cabal.project.freeze - travis_retry ${CABAL} v2-update -v # Generate cabal.project - rm -rf cabal.project cabal.project.local cabal.project.freeze - touch cabal.project - | echo 'packages: "."' >> cabal.project - | echo "write-ghc-environment-files: always" >> cabal.project - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(void)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - cat cabal.project || true - cat cabal.project.local || true - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi - ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" - rm cabal.project.freeze - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} --dep -j2 all | color_cabal_output script: - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) # Packaging... - ${CABAL} v2-sdist all | color_cabal_output # Unpacking... - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/ - cd ${DISTDIR} || false - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; # Generate cabal.project - rm -rf cabal.project cabal.project.local cabal.project.freeze - touch cabal.project - | echo 'packages: "void-*/*.cabal"' >> cabal.project - | echo "write-ghc-environment-files: always" >> cabal.project - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(void)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" - cat cabal.project || true - cat cabal.project.local || true # Building with tests and benchmarks... # build & run tests, build benchmarks - ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output # cabal check... - (cd void-* && ${CABAL} -vnormal check) # haddock... - ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output # REGENDATA ["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"] # EOF void-0.7.3/.vim.custom0000755000000000000000000000137707346545000012773 0ustar0000000000000000" Add the following to your .vimrc to automatically load this on startup " if filereadable(".vim.custom") " so .vim.custom " endif function StripTrailingWhitespace() let myline=line(".") let mycolumn = col(".") silent %s/ *$// call cursor(myline, mycolumn) endfunction " enable syntax highlighting syntax on " search for the tags file anywhere between here and / set tags=TAGS;/ " highlight tabs and trailing spaces set listchars=tab:‗‗,trail:‗ set list " f2 runs hasktags map :exec ":!hasktags -x -c --ignore src" " strip trailing whitespace before saving " au BufWritePre *.hs,*.markdown silent! cal StripTrailingWhitespace() " rebuild hasktags after saving au BufWritePost *.hs silent! :exec ":!hasktags -x -c --ignore src" void-0.7.3/CHANGELOG.markdown0000755000000000000000000000124007346545000013706 0ustar00000000000000000.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` * `vacuousM` removed 0.6 --- * `instance Exception Void` * `instance Generic Void` * `instance Hashable Void` 0.5.12 ------ * Fixed compatibility with GHC 7.2 (#6) * Added `CHANGELOG.markdown` and `README.markdown` void-0.7.3/LICENSE0000644000000000000000000000265307346545000011666 0ustar0000000000000000Copyright 2015 Edward Kmett All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the author nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. void-0.7.3/README.markdown0000755000000000000000000000106007346545000013354 0ustar0000000000000000void ==== [![Hackage](https://img.shields.io/hackage/v/void.svg)](https://hackage.haskell.org/package/void) [![Build Status](https://secure.travis-ci.org/ekmett/void.png?branch=master)](http://travis-ci.org/ekmett/void) This package provides a canonical 'uninhabited' data type for Haskell. This arises in a surprisingly wide array of situations in practice. Contact Information ------------------- Contributions and bug reports are welcome! Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net. -Edward Kmett void-0.7.3/Setup.lhs0000644000000000000000000000016507346545000012465 0ustar0000000000000000#!/usr/bin/runhaskell > module Main (main) where > import Distribution.Simple > main :: IO () > main = defaultMain void-0.7.3/src-old/Data/0000755000000000000000000000000007346545000013067 5ustar0000000000000000void-0.7.3/src-old/Data/Void.hs0000644000000000000000000000541507346545000014331 0ustar0000000000000000{-# 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 #ifndef MIN_VERSION_semigroups #define MIN_VERSION_semigroups(x,y,z) 1 #endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2008-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett -- Stability : provisional -- Portability : portable -- ---------------------------------------------------------------------------- module Data.Void ( Void , absurd , vacuous , vacuousM ) where import Control.DeepSeq (NFData(..)) 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 import Language.Haskell.TH.Syntax (Lift (..)) -- | 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 #if MIN_VERSION_semigroups(0,17,0) stimes _ a = a #else times1p _ a = a #endif instance Ix Void where range _ = [] index _ = absurd inRange _ = absurd rangeSize _ = 0 #if MIN_VERSION_base(4,0,0) instance Exception Void #endif -- | Defined as @'rnf' = 'absurd'@. instance NFData Void where rnf = absurd instance Lift Void where lift = return . absurd void-0.7.3/src/Data/Void/0000755000000000000000000000000007346545000013214 5ustar0000000000000000void-0.7.3/src/Data/Void/Unsafe.hs0000644000000000000000000000265007346545000014774 0ustar0000000000000000{-# LANGUAGE CPP #-} #if !defined(SAFE) && defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 #define UNSAFE {-# LANGUAGE Unsafe #-} #endif #if __GLASGOW_HASKELL__ >= 800 {-# OPTIONS_GHC -Wno-redundant-constraints #-} -- they aren't redundant! #endif ----------------------------------------------------------------------------- -- | -- Copyright : (C) 2008-2015 Edward Kmett -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Edward Kmett -- Stability : provisional -- Portability : portable -- ---------------------------------------------------------------------------- module Data.Void.Unsafe ( unsafeVacuous , unsafeVacuousM ) where import Data.Void #ifdef UNSAFE import Unsafe.Coerce #endif -- | If 'Void' is uninhabited than 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. unsafeVacuous :: Functor f => f Void -> f a #ifdef UNSAFE unsafeVacuous = unsafeCoerce #else unsafeVacuous = fmap absurd #endif -- | If 'Void' is uninhabited then any 'Monad' that holds values of type 'Void' -- is holding no values. -- -- This is only safe for valid monads that do not perform GADT-like analysis on the argument. unsafeVacuousM :: Monad m => m Void -> m a #ifdef UNSAFE unsafeVacuousM = unsafeCoerce #else unsafeVacuousM m = m >>= return . absurd #endif void-0.7.3/void.cabal0000644000000000000000000000350107346545000012577 0ustar0000000000000000name: void category: Data Structures version: 0.7.3 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE author: Edward A. Kmett maintainer: Edward A. Kmett stability: portable homepage: http://github.com/ekmett/void bug-reports: http://github.com/ekmett/void/issues 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==8.8.1 , GHC==8.6.5 , GHC==8.4.4 , GHC==8.2.2 , GHC==8.0.2 , GHC==7.10.3 , GHC==7.8.4 , GHC==7.6.3 , GHC==7.4.2 , GHC==7.2.2 , GHC==7.0.4 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 flag safe manual: True default: False library default-language: Haskell98 hs-source-dirs: src exposed-modules: Data.Void.Unsafe build-depends: base >= 3 && < 10 ghc-options: -Wall if flag(safe) cpp-options: -DSAFE if !impl(ghc>=7.9) hs-source-dirs: src-old exposed-modules: Data.Void build-depends: deepseq >= 1.1 && < 1.5, hashable >= 1.1, semigroups >= 0.8.2, template-haskell >=2.5.0.0 && <2.11 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