├── cabal.project ├── .ghci ├── Setup.lhs ├── cabal.haskell-ci ├── .gitignore ├── README.markdown ├── .vim.custom ├── CHANGELOG.markdown ├── LICENSE ├── src └── Data │ └── Void │ └── Unsafe.hs ├── void.cabal ├── src-old └── Data │ └── Void.hs └── .github └── workflows └── haskell-ci.yml /cabal.project: -------------------------------------------------------------------------------- 1 | packages: . 2 | -------------------------------------------------------------------------------- /.ghci: -------------------------------------------------------------------------------- 1 | :set -isrc -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h 2 | -------------------------------------------------------------------------------- /Setup.lhs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/runhaskell 2 | > module Main (main) where 3 | 4 | > import Distribution.Simple 5 | 6 | > main :: IO () 7 | > main = defaultMain 8 | -------------------------------------------------------------------------------- /cabal.haskell-ci: -------------------------------------------------------------------------------- 1 | no-tests-no-benchmarks: False 2 | unconstrained: False 3 | -- irc-channels: irc.freenode.org#haskell-lens 4 | irc-if-in-origin-repo: True 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.hi 3 | *.o 4 | *~ 5 | .*.swo 6 | .*.swp 7 | .swp 8 | .DS_Store 9 | TAGS 10 | _darcs 11 | dist 12 | docs 13 | tags 14 | wiki 15 | wip 16 | dist-newstyle/ 17 | .stack-work/ 18 | cabal-dev 19 | *.chi 20 | *.chs.h 21 | *.dyn_o 22 | *.dyn_hi 23 | .hpc 24 | .hsenv 25 | .cabal-sandbox/ 26 | cabal.sandbox.config 27 | *.prof 28 | *.aux 29 | *.hp 30 | *.eventlog 31 | cabal.project.local 32 | cabal.project.local~ 33 | .HTF/ 34 | .ghc.environment.* 35 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | void 2 | ==== 3 | 4 | [![Hackage](https://img.shields.io/hackage/v/void.svg)](https://hackage.haskell.org/package/void) [![Build Status](https://github.com/ekmett/void/workflows/Haskell-CI/badge.svg)](https://github.com/ekmett/void/actions?query=workflow%3AHaskell-CI) 5 | 6 | This package provides a canonical 'uninhabited' data type for Haskell. This arises in a surprisingly wide array of situations in practice. 7 | 8 | Contact Information 9 | ------------------- 10 | 11 | Contributions and bug reports are welcome! 12 | 13 | Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net. 14 | 15 | -Edward Kmett 16 | -------------------------------------------------------------------------------- /.vim.custom: -------------------------------------------------------------------------------- 1 | " Add the following to your .vimrc to automatically load this on startup 2 | 3 | " if filereadable(".vim.custom") 4 | " so .vim.custom 5 | " endif 6 | 7 | function StripTrailingWhitespace() 8 | let myline=line(".") 9 | let mycolumn = col(".") 10 | silent %s/ *$// 11 | call cursor(myline, mycolumn) 12 | endfunction 13 | 14 | " enable syntax highlighting 15 | syntax on 16 | 17 | " search for the tags file anywhere between here and / 18 | set tags=TAGS;/ 19 | 20 | " highlight tabs and trailing spaces 21 | set listchars=tab:‗‗,trail:‗ 22 | set list 23 | 24 | " f2 runs hasktags 25 | map :exec ":!hasktags -x -c --ignore src" 26 | 27 | " strip trailing whitespace before saving 28 | " au BufWritePre *.hs,*.markdown silent! cal StripTrailingWhitespace() 29 | 30 | " rebuild hasktags after saving 31 | au BufWritePost *.hs silent! :exec ":!hasktags -x -c --ignore src" 32 | -------------------------------------------------------------------------------- /CHANGELOG.markdown: -------------------------------------------------------------------------------- 1 | 0.7.4 [2025.12.08] 2 | ------------------ 3 | * Drop support for pre-8.0 versions of GHC. 4 | 5 | 0.7.3 [2019.05.10] 6 | ------------------ 7 | * Backport the `Lift Void` instance introduced in `template-haskell-2.15.0.0`. 8 | 9 | 0.7.2 10 | ----- 11 | * Only depend on `deepseq`, `hashable`, and `semigroups` if using GHC 7.8 or earlier. 12 | * Cleaned up spurious "redundant constraint" warnings on GHC 8+ 13 | 14 | 0.7.1 15 | ----- 16 | * Support `semigroups` 0.17 on older GHCs 17 | * Backported `NFData`'s `semigroup` instance to older GHCs. 18 | 19 | 0.7 20 | --- 21 | * adapt to `Data.Void` being moved into `base-4.8` 22 | * `vacuousM` removed 23 | 24 | 0.6 25 | --- 26 | * `instance Exception Void` 27 | * `instance Generic Void` 28 | * `instance Hashable Void` 29 | 30 | 0.5.12 31 | ------ 32 | * Fixed compatibility with GHC 7.2 (#6) 33 | * Added `CHANGELOG.markdown` and `README.markdown` 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 Edward Kmett 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the author nor the names of his contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 21 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 24 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 29 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /src/Data/Void/Unsafe.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | #if !defined(SAFE) && defined(__GLASGOW_HASKELL__) 3 | #define UNSAFE 4 | {-# LANGUAGE Unsafe #-} 5 | #endif 6 | {-# OPTIONS_GHC -Wno-redundant-constraints #-} -- they aren't redundant! 7 | ----------------------------------------------------------------------------- 8 | -- | 9 | -- Copyright : (C) 2008-2015 Edward Kmett 10 | -- License : BSD-style (see the file LICENSE) 11 | -- 12 | -- Maintainer : Edward Kmett 13 | -- Stability : provisional 14 | -- Portability : portable 15 | -- 16 | ---------------------------------------------------------------------------- 17 | module Data.Void.Unsafe 18 | ( unsafeVacuous 19 | , unsafeVacuousM 20 | ) where 21 | 22 | import Data.Void 23 | 24 | #ifdef UNSAFE 25 | import Unsafe.Coerce 26 | #endif 27 | 28 | -- | If 'Void' is uninhabited then any 'Functor' that holds only values of the type 'Void' 29 | -- is holding no values. 30 | -- 31 | -- This is only safe for valid functors that do not perform GADT-like analysis on the argument. 32 | unsafeVacuous :: Functor f => f Void -> f a 33 | #ifdef UNSAFE 34 | unsafeVacuous = unsafeCoerce 35 | #else 36 | unsafeVacuous = fmap absurd 37 | #endif 38 | 39 | -- | If 'Void' is uninhabited then any 'Monad' that holds values of type 'Void' 40 | -- is holding no values. 41 | -- 42 | -- This is only safe for valid monads that do not perform GADT-like analysis on the argument. 43 | unsafeVacuousM :: Monad m => m Void -> m a 44 | #ifdef UNSAFE 45 | unsafeVacuousM = unsafeCoerce 46 | #else 47 | unsafeVacuousM m = m >>= return . absurd 48 | #endif 49 | -------------------------------------------------------------------------------- /void.cabal: -------------------------------------------------------------------------------- 1 | name: void 2 | category: Data Structures 3 | version: 0.7.4 4 | license: BSD3 5 | cabal-version: >= 1.10 6 | license-file: LICENSE 7 | author: Edward A. Kmett 8 | maintainer: Edward A. Kmett 9 | stability: portable 10 | homepage: http://github.com/ekmett/void 11 | bug-reports: http://github.com/ekmett/void/issues 12 | copyright: Copyright (C) 2008-2015 Edward A. Kmett 13 | synopsis: A Haskell 98 logically uninhabited data type 14 | description: A Haskell 98 logically uninhabited data type, used to indicate that a given term should not exist. 15 | build-type: Simple 16 | tested-with: GHC==9.12.2 17 | , GHC==9.10.3 18 | , GHC==9.8.4 19 | , GHC==9.6.6 20 | , GHC==9.4.8 21 | , GHC==9.2.8 22 | , GHC==9.0.2 23 | , GHC==8.10.7 24 | , GHC==8.8.4 25 | , GHC==8.6.5 26 | , GHC==8.4.4 27 | , GHC==8.2.2 28 | , GHC==8.0.2 29 | 30 | extra-source-files: 31 | .ghci 32 | .gitignore 33 | .vim.custom 34 | CHANGELOG.markdown 35 | README.markdown 36 | 37 | source-repository head 38 | type: git 39 | location: https://github.com/ekmett/void.git 40 | 41 | flag safe 42 | manual: True 43 | default: False 44 | 45 | library 46 | default-language: Haskell98 47 | hs-source-dirs: src 48 | exposed-modules: 49 | Data.Void.Unsafe 50 | 51 | build-depends: base >= 3 && < 10 52 | 53 | ghc-options: -Wall 54 | 55 | if flag(safe) 56 | cpp-options: -DSAFE 57 | -------------------------------------------------------------------------------- /src-old/Data/Void.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702 3 | {-# LANGUAGE Trustworthy #-} 4 | #endif 5 | 6 | #ifdef LANGUAGE_DeriveDataTypeable 7 | {-# LANGUAGE DeriveDataTypeable #-} 8 | #endif 9 | 10 | #ifdef LANGUAGE_DeriveGeneric 11 | {-# LANGUAGE DeriveGeneric #-} 12 | {-# LANGUAGE StandaloneDeriving #-} 13 | #endif 14 | 15 | #ifndef MIN_VERSION_base 16 | #define MIN_VERSION_base(x,y,z) 1 17 | #endif 18 | 19 | #ifndef MIN_VERSION_semigroups 20 | #define MIN_VERSION_semigroups(x,y,z) 1 21 | #endif 22 | ----------------------------------------------------------------------------- 23 | -- | 24 | -- Copyright : (C) 2008-2015 Edward Kmett 25 | -- License : BSD-style (see the file LICENSE) 26 | -- 27 | -- Maintainer : Edward Kmett 28 | -- Stability : provisional 29 | -- Portability : portable 30 | -- 31 | ---------------------------------------------------------------------------- 32 | module Data.Void 33 | ( Void 34 | , absurd 35 | , vacuous 36 | , vacuousM 37 | ) where 38 | 39 | import Control.DeepSeq (NFData(..)) 40 | import Control.Monad (liftM) 41 | import Data.Ix 42 | import Data.Hashable 43 | import Data.Semigroup (Semigroup(..)) 44 | 45 | #ifdef LANGUAGE_DeriveDataTypeable 46 | import Data.Data 47 | #endif 48 | 49 | #ifdef LANGUAGE_DeriveGeneric 50 | import GHC.Generics 51 | #endif 52 | 53 | #if MIN_VERSION_base(4,0,0) 54 | import Control.Exception 55 | #endif 56 | 57 | import Language.Haskell.TH.Syntax (Lift (..)) 58 | 59 | -- | A logically uninhabited data type. 60 | #if __GLASGOW_HASKELL__ < 700 61 | data Void = Void !Void 62 | #else 63 | newtype Void = Void Void 64 | #endif 65 | #ifdef LANGUAGE_DeriveDataTypeable 66 | deriving (Data, Typeable) 67 | #endif 68 | 69 | #ifdef LANGUAGE_DeriveGeneric 70 | deriving instance Generic Void 71 | #endif 72 | 73 | instance Eq Void where 74 | _ == _ = True 75 | 76 | instance Hashable Void where 77 | hashWithSalt _ = absurd 78 | 79 | instance Ord Void where 80 | compare _ _ = EQ 81 | 82 | instance Show Void where 83 | showsPrec _ = absurd 84 | 85 | -- | Reading a 'Void' value is always a parse error, considering 'Void' as 86 | -- a data type with no constructors. 87 | instance Read Void where 88 | readsPrec _ _ = [] 89 | 90 | -- | Since 'Void' values logically don't exist, this witnesses the logical 91 | -- reasoning tool of \"ex falso quodlibet\". 92 | absurd :: Void -> a 93 | absurd a = a `seq` spin a where 94 | spin (Void b) = spin b 95 | 96 | -- | If 'Void' is uninhabited then any 'Functor' that holds only values of type 'Void' 97 | -- is holding no values. 98 | vacuous :: Functor f => f Void -> f a 99 | vacuous = fmap absurd 100 | 101 | -- | If 'Void' is uninhabited then any 'Monad' that holds values of type 'Void' 102 | -- is holding no values. 103 | vacuousM :: Monad m => m Void -> m a 104 | vacuousM = liftM absurd 105 | 106 | instance Semigroup Void where 107 | a <> _ = a 108 | #if MIN_VERSION_semigroups(0,17,0) 109 | stimes _ a = a 110 | #else 111 | times1p _ a = a 112 | #endif 113 | 114 | instance Ix Void where 115 | range _ = [] 116 | index _ = absurd 117 | inRange _ = absurd 118 | rangeSize _ = 0 119 | 120 | #if MIN_VERSION_base(4,0,0) 121 | instance Exception Void 122 | #endif 123 | 124 | -- | Defined as @'rnf' = 'absurd'@. 125 | instance NFData Void where 126 | rnf = absurd 127 | 128 | instance Lift Void where 129 | lift = return . absurd 130 | -------------------------------------------------------------------------------- /.github/workflows/haskell-ci.yml: -------------------------------------------------------------------------------- 1 | # This GitHub workflow config has been generated by a script via 2 | # 3 | # haskell-ci 'github' '--config=cabal.haskell-ci' 'cabal.project' 4 | # 5 | # To regenerate the script (for example after adjusting tested-with) run 6 | # 7 | # haskell-ci regenerate 8 | # 9 | # For more information, see https://github.com/haskell-CI/haskell-ci 10 | # 11 | # version: 0.19.20250917 12 | # 13 | # REGENDATA ("0.19.20250917",["github","--config=cabal.haskell-ci","cabal.project"]) 14 | # 15 | name: Haskell-CI 16 | on: 17 | - push 18 | - pull_request 19 | - merge_group 20 | jobs: 21 | linux: 22 | name: Haskell-CI - Linux - ${{ matrix.compiler }} 23 | runs-on: ubuntu-24.04 24 | timeout-minutes: 25 | 60 26 | container: 27 | image: buildpack-deps:jammy 28 | continue-on-error: ${{ matrix.allow-failure }} 29 | strategy: 30 | matrix: 31 | include: 32 | - compiler: ghc-9.12.2 33 | compilerKind: ghc 34 | compilerVersion: 9.12.2 35 | setup-method: ghcup 36 | allow-failure: false 37 | - compiler: ghc-9.10.3 38 | compilerKind: ghc 39 | compilerVersion: 9.10.3 40 | setup-method: ghcup 41 | allow-failure: false 42 | - compiler: ghc-9.8.4 43 | compilerKind: ghc 44 | compilerVersion: 9.8.4 45 | setup-method: ghcup 46 | allow-failure: false 47 | - compiler: ghc-9.6.6 48 | compilerKind: ghc 49 | compilerVersion: 9.6.6 50 | setup-method: ghcup 51 | allow-failure: false 52 | - compiler: ghc-9.4.8 53 | compilerKind: ghc 54 | compilerVersion: 9.4.8 55 | setup-method: ghcup 56 | allow-failure: false 57 | - compiler: ghc-9.2.8 58 | compilerKind: ghc 59 | compilerVersion: 9.2.8 60 | setup-method: ghcup 61 | allow-failure: false 62 | - compiler: ghc-9.0.2 63 | compilerKind: ghc 64 | compilerVersion: 9.0.2 65 | setup-method: ghcup 66 | allow-failure: false 67 | - compiler: ghc-8.10.7 68 | compilerKind: ghc 69 | compilerVersion: 8.10.7 70 | setup-method: ghcup 71 | allow-failure: false 72 | - compiler: ghc-8.8.4 73 | compilerKind: ghc 74 | compilerVersion: 8.8.4 75 | setup-method: ghcup 76 | allow-failure: false 77 | - compiler: ghc-8.6.5 78 | compilerKind: ghc 79 | compilerVersion: 8.6.5 80 | setup-method: ghcup 81 | allow-failure: false 82 | - compiler: ghc-8.4.4 83 | compilerKind: ghc 84 | compilerVersion: 8.4.4 85 | setup-method: ghcup 86 | allow-failure: false 87 | - compiler: ghc-8.2.2 88 | compilerKind: ghc 89 | compilerVersion: 8.2.2 90 | setup-method: ghcup 91 | allow-failure: false 92 | - compiler: ghc-8.0.2 93 | compilerKind: ghc 94 | compilerVersion: 8.0.2 95 | setup-method: ghcup 96 | allow-failure: false 97 | fail-fast: false 98 | steps: 99 | - name: apt-get install 100 | run: | 101 | apt-get update 102 | apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev 103 | - name: Install GHCup 104 | run: | 105 | mkdir -p "$HOME/.ghcup/bin" 106 | curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup" 107 | chmod a+x "$HOME/.ghcup/bin/ghcup" 108 | - name: Install cabal-install 109 | run: | 110 | "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false) 111 | echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV" 112 | - name: Install GHC (GHCup) 113 | if: matrix.setup-method == 'ghcup' 114 | run: | 115 | "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) 116 | HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") 117 | HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') 118 | HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') 119 | echo "HC=$HC" >> "$GITHUB_ENV" 120 | echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" 121 | echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" 122 | env: 123 | HCKIND: ${{ matrix.compilerKind }} 124 | HCNAME: ${{ matrix.compiler }} 125 | HCVER: ${{ matrix.compilerVersion }} 126 | - name: Set PATH and environment variables 127 | run: | 128 | echo "$HOME/.cabal/bin" >> $GITHUB_PATH 129 | echo "LANG=C.UTF-8" >> "$GITHUB_ENV" 130 | echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" 131 | echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" 132 | HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') 133 | echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" 134 | echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" 135 | echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" 136 | echo "HEADHACKAGE=false" >> "$GITHUB_ENV" 137 | echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" 138 | env: 139 | HCKIND: ${{ matrix.compilerKind }} 140 | HCNAME: ${{ matrix.compiler }} 141 | HCVER: ${{ matrix.compilerVersion }} 142 | - name: env 143 | run: | 144 | env 145 | - name: write cabal config 146 | run: | 147 | mkdir -p $CABAL_DIR 148 | cat >> $CABAL_CONFIG <> $CABAL_CONFIG < cabal-plan.xz 181 | echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - 182 | xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan 183 | rm -f cabal-plan.xz 184 | chmod a+x $HOME/.cabal/bin/cabal-plan 185 | cabal-plan --version 186 | - name: checkout 187 | uses: actions/checkout@v5 188 | with: 189 | path: source 190 | - name: initial cabal.project for sdist 191 | run: | 192 | touch cabal.project 193 | echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project 194 | cat cabal.project 195 | - name: sdist 196 | run: | 197 | mkdir -p sdist 198 | $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist 199 | - name: unpack 200 | run: | 201 | mkdir -p unpacked 202 | find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; 203 | - name: generate cabal.project 204 | run: | 205 | PKGDIR_void="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/void-[0-9.]*')" 206 | echo "PKGDIR_void=${PKGDIR_void}" >> "$GITHUB_ENV" 207 | rm -f cabal.project cabal.project.local 208 | touch cabal.project 209 | touch cabal.project.local 210 | echo "packages: ${PKGDIR_void}" >> cabal.project 211 | if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package void" >> cabal.project ; fi 212 | if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi 213 | if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package void" >> cabal.project ; fi 214 | if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi 215 | if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package void" >> cabal.project ; fi 216 | if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi 217 | cat >> cabal.project <> cabal.project.local 220 | cat cabal.project 221 | cat cabal.project.local 222 | - name: dump install plan 223 | run: | 224 | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all 225 | cabal-plan 226 | - name: restore cache 227 | uses: actions/cache/restore@v4 228 | with: 229 | key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} 230 | path: ~/.cabal/store 231 | restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- 232 | - name: install dependencies 233 | run: | 234 | $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all 235 | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all 236 | - name: build 237 | run: | 238 | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always 239 | - name: cabal check 240 | run: | 241 | cd ${PKGDIR_void} || false 242 | ${CABAL} -vnormal check 243 | - name: haddock 244 | run: | 245 | $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all 246 | - name: save cache 247 | if: always() 248 | uses: actions/cache/save@v4 249 | with: 250 | key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} 251 | path: ~/.cabal/store 252 | --------------------------------------------------------------------------------