mirror of
https://github.com/Lysxia/first-class-families.git
synced 2024-09-11 19:47:12 +03:00
commit
72dc162e75
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||
os: [ubuntu-latest]
|
||||
cabal: ["3.2"]
|
||||
ghc:
|
||||
- "8.0"
|
||||
@ -21,29 +21,20 @@ jobs:
|
||||
- "8.6"
|
||||
- "8.8"
|
||||
- "8.10"
|
||||
exclude:
|
||||
- os: macOS-latest
|
||||
ghc: 8.8
|
||||
- os: macOS-latest
|
||||
ghc: 8.6
|
||||
- os: macOS-latest
|
||||
ghc: 8.4
|
||||
- os: macOS-latest
|
||||
ghc: 8.2
|
||||
- os: macOS-latest
|
||||
ghc: 8.0
|
||||
- os: windows-latest
|
||||
ghc: 8.8
|
||||
- os: windows-latest
|
||||
ghc: 8.6
|
||||
- os: windows-latest
|
||||
ghc: 8.4
|
||||
- os: windows-latest
|
||||
ghc: 8.2
|
||||
- os: windows-latest
|
||||
ghc: 8.0
|
||||
|
||||
- "9.0"
|
||||
steps:
|
||||
- name: Set environment
|
||||
run: |
|
||||
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
|
||||
- name: Install cabal-docspec
|
||||
run: |
|
||||
mkdir -p $HOME/.cabal/bin
|
||||
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz > cabal-docspec.xz
|
||||
echo '0829bd034fba901cbcfe491d98ed8b28fd54f9cb5c91fa8e1ac62dc4413c9562 cabal-docspec.xz' | sha256sum -c -
|
||||
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
|
||||
rm -f cabal-docspec.xz
|
||||
chmod a+x $HOME/.cabal/bin/cabal-docspec
|
||||
cabal-docspec --version
|
||||
- uses: actions/checkout@v2
|
||||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
||||
|
||||
@ -79,6 +70,7 @@ jobs:
|
||||
- name: Test
|
||||
run: |
|
||||
cabal test all
|
||||
cabal-docspec
|
||||
|
||||
stack:
|
||||
name: stack / ghc ${{ matrix.ghc }}
|
||||
@ -86,7 +78,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
stack: ["latest"]
|
||||
ghc: ["8.8"]
|
||||
ghc: ["8.10"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -17,7 +17,7 @@ build-type: Simple
|
||||
extra-source-files: README.md, CHANGELOG.md
|
||||
cabal-version: >=1.10
|
||||
tested-with:
|
||||
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.1, GHC == 8.10.1
|
||||
GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.1, GHC == 8.10.1, GHC == 9.0.1
|
||||
|
||||
library
|
||||
hs-source-dirs: src
|
||||
@ -41,7 +41,7 @@ library
|
||||
Fcf.Utils
|
||||
build-depends:
|
||||
-- This upper bound is conservative.
|
||||
base >= 4.9 && < 4.15
|
||||
base >= 4.9 && < 4.16
|
||||
ghc-options: -Wall
|
||||
default-language: Haskell2010
|
||||
|
||||
@ -54,19 +54,6 @@ test-suite fcf-test
|
||||
base,
|
||||
first-class-families
|
||||
|
||||
test-suite fcf-doctest
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: test
|
||||
main-is: doctest.hs
|
||||
default-language: Haskell2010
|
||||
if impl(ghc >= 8.6)
|
||||
build-depends:
|
||||
base,
|
||||
doctest,
|
||||
Glob
|
||||
else
|
||||
buildable: False
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
location: https://github.com/Lysxia/first-class-families
|
||||
|
@ -21,6 +21,7 @@ import Fcf.Core (Exp, Eval)
|
||||
import Fcf.Combinators (Pure)
|
||||
|
||||
-- $setup
|
||||
-- >>> import Fcf.Core (Eval)
|
||||
-- >>> import Fcf.Combinators (Flip)
|
||||
-- >>> import Fcf.Data.Nat (Nat, type (+), type (-))
|
||||
-- >>> import Fcf.Data.Symbol (Symbol)
|
||||
|
@ -13,6 +13,12 @@ module Fcf.Class.Functor
|
||||
|
||||
import Fcf.Core (Exp, Eval)
|
||||
|
||||
-- $setup
|
||||
-- >>> :set -XUndecidableInstances -XTypeInType
|
||||
-- >>> import Fcf.Core (Eval, Exp)
|
||||
-- >>> import Fcf.Data.Nat
|
||||
-- >>> import qualified GHC.TypeLits as TL
|
||||
|
||||
-- | Type-level 'fmap' for type-level functors.
|
||||
--
|
||||
-- Note: this name clashes with 'Data.Map.Lazy.Map' from /containers/.
|
||||
@ -20,8 +26,6 @@ import Fcf.Core (Exp, Eval)
|
||||
--
|
||||
-- === __Example__
|
||||
--
|
||||
-- >>> import Fcf.Data.Nat
|
||||
-- >>> import qualified GHC.TypeLits as TL
|
||||
-- >>> data AddMul :: Nat -> Nat -> Exp Nat
|
||||
-- >>> type instance Eval (AddMul x y) = (x TL.+ y) TL.* (x TL.+ y)
|
||||
-- >>> :kind! Eval (Map (AddMul 2) '[0, 1, 2, 3, 4])
|
||||
|
@ -29,6 +29,9 @@ import Fcf.Class.Monoid (type (<>)) -- Semigroup Ordering
|
||||
import Fcf.Data.Bool (Not)
|
||||
import Fcf.Utils (TyEq)
|
||||
|
||||
-- $setup
|
||||
-- >>> import Fcf.Core (Eval)
|
||||
|
||||
-- | Type-level 'compare' for totally ordered data types.
|
||||
--
|
||||
-- === __Example__
|
||||
|
@ -19,6 +19,9 @@ module Fcf.Data.Bool
|
||||
|
||||
import Fcf.Core
|
||||
|
||||
-- $setup
|
||||
-- >>> :set -XTypeFamilies
|
||||
|
||||
-- | N.B.: The order of the two branches is the opposite of "if":
|
||||
-- @UnBool ifFalse ifTrue bool@.
|
||||
--
|
||||
|
@ -18,6 +18,8 @@ import Fcf.Core
|
||||
infixl 1 &
|
||||
|
||||
-- $setup
|
||||
-- >>> :set -XTypeFamilies -XDataKinds -XTypeOperators
|
||||
-- >>> import Fcf.Core
|
||||
-- >>> import Fcf.Combinators (Pure)
|
||||
-- >>> import Fcf.Data.Common (Fst)
|
||||
-- >>> import Fcf.Data.Bool (type (&&), type (||))
|
||||
|
@ -82,9 +82,11 @@ import Fcf.Data.Nat
|
||||
import Fcf.Utils (If, TyEq)
|
||||
|
||||
-- $setup
|
||||
-- >>> import Fcf.Core
|
||||
-- >>> import Fcf.Core (Eval)
|
||||
-- >>> import Fcf.Combinators
|
||||
-- >>> import Fcf.Class.Monoid ()
|
||||
-- >>> import qualified GHC.TypeLits as TL
|
||||
-- >>> import GHC.TypeLits (Nat)
|
||||
|
||||
|
||||
-- | List catenation.
|
||||
|
@ -1,16 +0,0 @@
|
||||
import System.FilePath.Glob (glob)
|
||||
import Test.DocTest
|
||||
|
||||
exts :: [String]
|
||||
exts =
|
||||
[ "-XDataKinds"
|
||||
, "-XKindSignatures"
|
||||
, "-XTypeFamilies"
|
||||
, "-XTypeOperators"
|
||||
, "-XUndecidableInstances"
|
||||
]
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
xs <- glob "src/**/*.hs"
|
||||
doctest (exts ++ xs)
|
Loading…
Reference in New Issue
Block a user