cabal-version: 3.0 name: yaya-unsafe version: 0.4.1.1 synopsis: Non-total extensions to the Yaya recursion scheme library. description: Yaya is designed as a _total_ library. However, it is often expedient to use partial operations in some cases, and this package extends Yaya to provide those operations. It’s in a separate package (and modules) in order to make sure its use is very intentional and also relatively obvious to those reading your code. It’s recommended that you import these modules qualified and, in particular, all the type class instances here have been pulled into a separate module to avoid accidentally bringing them into scope. author: Greg Pfeil maintainer: Greg Pfeil copyright: 2017 Greg Pfeil homepage: https://github.com/sellout/yaya#readme bug-reports: https://github.com/sellout/yaya/issues category: Recursion build-type: Custom license: AGPL-3.0-or-later license-files: LICENSE extra-source-files: CHANGELOG.md README.md tested-with: GHC == { -- GHCup Nixpkgs 8.6.1, 8.8.1, 8.8.4, 8.10.1, 9.0.1, 9.2.1, 9.4.1, 9.4.8, 9.6.1, 9.8.1 } source-repository head type: git location: https://github.com/sellout/yaya -- This mimics the GHC2021 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2021), -- but supporting compilers back to GHC 7.10. If the oldest supported compiler -- is GHC 9.2, then this stanza can be removed and `import: GHC2021` can be -- replaced by `default-language: GHC2021`. common GHC2021 default-language: Haskell2010 default-extensions: BangPatterns BinaryLiterals ConstraintKinds DeriveDataTypeable DeriveGeneric -- DeriveLift -- uncomment if the oldest supported version is GHC 8.10.1+ DeriveTraversable DerivingStrategies DoAndIfThenElse EmptyCase ExistentialQuantification FlexibleContexts FlexibleInstances GADTSyntax GeneralizedNewtypeDeriving HexFloatLiterals -- ImportQualifiedPost -- uncomment if the oldest supported version is GHC 8.10.1+ InstanceSigs LambdaCase MagicHash MonadComprehensions MonomorphismRestriction MultiParamTypeClasses NamedFieldPuns NamedWildCards NumericUnderscores PolyKinds PostfixOperators RankNTypes ScopedTypeVariables StandaloneDeriving -- StandaloneKindSignatures -- uncomment if the oldest supported version is GHC 8.10.1+ TupleSections TypeApplications TypeOperators UnicodeSyntax NoExplicitNamespaces common defaults import: GHC2021 build-depends: base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, ghc-options: -Weverything -- Type inference good. -Wno-missing-local-signatures -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 -Wno-unsafe -- TODO: prune these warnings -Wno-all-missed-specialisations -fpackage-trust -trust base if impl(ghc < 8.8.1) ghc-options: -- This used to warn even when `Safe` was explicit. -Wno-safe if impl(ghc >= 8.10.1) ghc-options: -- If we didn’t allow inferred-safe imports, nothing would be `Safe`. -Wno-inferred-safe-imports -- We support GHC versions without qualified-post. -Wno-prepositive-qualified-module -- `-trust` triggers this warning when applied to transitive dependencies. -Wno-unused-packages if impl(ghc >= 9.2.1) ghc-options: -- We support GHC versions without kind signatures. -Wno-missing-kind-signatures if impl(ghc >= 9.8.1) ghc-options: -- We support GHC versions without kind signatures. -Wno-missing-poly-kind-signatures -- Inference good. -Wno-missing-role-annotations default-extensions: DefaultSignatures ExplicitNamespaces FunctionalDependencies LiberalTypeSynonyms -- replace with `LexicalNegation` if the oldest supported version is GHC 9.0.1+ NegativeLiterals PackageImports ParallelListComp -- QualifiedDo - uncomment if the oldest supported version is GHC 9.0.1+ RecursiveDo -- RequiredTypeArguments - uncomment if the oldest supported version is GHC 9.10.1+ RoleAnnotations StrictData TemplateHaskellQuotes TransformListComp NoGeneralizedNewtypeDeriving NoImplicitPrelude NoMonomorphismRestriction NoPatternGuards NoTypeApplications custom-setup setup-depends: -- TODO: Remove `Cabal` dep once haskell/cabal#3751 is fixed. Cabal ^>= {3.0.0, 3.2.0, 3.4.0, 3.6.0, 3.8.0, 3.10.0}, base ^>= {4.12.0, 4.13.0, 4.14.0, 4.15.0, 4.16.0, 4.17.0, 4.18.0, 4.19.0}, cabal-doctest ^>= {1.0.0}, library import: defaults hs-source-dirs: src exposed-modules: Yaya.Unsafe.Applied Yaya.Unsafe.Fold Yaya.Unsafe.Fold.Instances Yaya.Unsafe.Zoo build-depends: bifunctors ^>= {5.5.7, 5.6}, comonad ^>= 5.0.7, free ^>= {5.1.5, 5.2}, -- `Control.Lens` in lens < 5 is `Unsafe` lens ^>= {5, 5.1, 5.2}, yaya ^>= {0.5.1, 0.6.0}, ghc-options: -trust adjunctions -trust array -trust base-orphans -trust binary -trust bytestring -trust containers -trust distributive -trust exceptions -trust foldable1-classes-compat -trust ghc-prim -trust hashable -trust lens -trust profunctors -trust semigroupoids -trust stm -trust text -trust transformers-compat test-suite doctests import: defaults type: exitcode-stdio-1.0 hs-source-dirs: tests main-is: doctests.hs build-depends: doctest ^>= {0.16.0, 0.18.1, 0.20.1, 0.21.1, 0.22.2}, yaya-unsafe, -- TODO: The sections below here are necessary because we don’t have control -- over the generated `Build_doctests.hs` file. So we have to silence -- all of its warnings one way or another. ghc-options: -Wno-missing-export-lists -Wno-missing-import-lists -Wno-safe if impl(ghc >= 8.8.1) ghc-options: -- This used to warn even when `Safe` was explicit. -Wno-missing-deriving-strategies default-extensions: -- Since we can’t add `{-# LANGUAGE Safe -#}` to the generated -- “Build_doctests.hs”, we set it here, and that means it has to match -- doctests.hs, which is `Unsafe`. Unsafe test-suite yaya-unsafe import: defaults type: exitcode-stdio-1.0 hs-source-dirs: tests main-is: test.hs other-modules: Test.Fold build-depends: hedgehog ^>= {1.0, 1.1, 1.2, 1.4}, yaya ^>= {0.5.1, 0.6.0}, yaya-hedgehog ^>= {0.2.1, 0.3.0}, yaya-unsafe, ghc-options: -- NB: Need `-fno-omit-yields` so that `timeout` can interrupt native -- recursion in non-termination tests. -fno-omit-yields -rtsopts -threaded -trust adjunctions -trust array -trust base-orphans -trust binary -trust bytestring -trust containers -trust distributive -trust exceptions -trust foldable1-classes-compat -trust ghc-prim -trust hashable -trust lens -trust profunctors -trust semigroupoids -trust stm -trust template-haskell -trust text -trust transformers-compat -with-rtsopts=-N