packages feed

some-1.1: some.cabal

cabal-version:      2.4
name:               some
version:            1.1
build-type:         Simple
author:
  James Cook <mokus@deepbondi.net>, Oleg Grenrus <oleg.grenrus@iki.fi>

maintainer:         Oleg Grenrus <oleg.grenrus@iki.fi>
license:            BSD-3-Clause
license-file:       LICENSE
homepage:           https://github.com/haskellari/some
category:           Data, Dependent Types
synopsis:           Existential type: Some
description:
  This library defines an existential type 'Some'.
  .
  @
  data Some f where
  \    Some :: f a -> Some f
  @
  .
  in few variants, and utilities to work with it.
  .
  If you are unsure which variant to use, use the one in "Data.Some" module.

tested-with:
  GHC ==9.6.7
   || ==9.8.4
   || ==9.10.2
   || ==9.12.2
   || ==9.14.1

extra-doc-files: ChangeLog.md

flag newtype-unsafe
  description:
    Use implementation using @newtype@ and unsafe @Any@, instead of GADT

  manual:      True
  default:     True

source-repository head
  type:     git
  location: https://github.com/haskellari/some.git
  subdir:   some

library
  default-language: Haskell2010
  hs-source-dirs:   src

  if flag(newtype-unsafe)
    cpp-options: -DSOME_NEWTYPE

  -- main module
  exposed-modules:  Data.Some
  exposed-modules:
    Data.EqP
    Data.GADT.Compare
    Data.GADT.DeepSeq
    Data.GADT.Show
    Data.OrdP
    Data.Some.Church
    Data.Some.GADT
    Data.Some.Newtype

  other-modules:    Data.GADT.Internal
  build-depends:
      base     >=4.18    && <4.23
    , deepseq  >=1.4.8.1 && <1.6

  if !impl(ghc >= 9.8)
    build-depends:
      base-orphans >= 0.9.1 && <0.10

  ghc-options: -Winferred-safe-imports -Wmissing-safe-haskell-mode
  ghc-options: -Wmissing-kind-signatures

test-suite hkd-example
  default-language: Haskell2010
  type:             exitcode-stdio-1.0
  hs-source-dirs:   test
  main-is:          HKD.hs
  build-depends:
      base
    , some