Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions OneTuple.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12
name: OneTuple
version: 0.4.2.1
version: 0.4.3
synopsis: Singleton Tuple
category: Data
description:
Expand Down Expand Up @@ -40,6 +40,14 @@ source-repository head
type: git
location: https://github.com/phadej/OneTuple.git

flag base-ge-4-15
default: True
manual: False

flag base-ge-4-16
default: True
manual: False

library
default-language: Haskell98
exposed-modules:
Expand All @@ -52,17 +60,31 @@ library
base >=4.12 && <4.23
, template-haskell

if impl(ghc >=9.0)
if flag(base-ge-4-15)
build-depends: ghc-prim

else
build-depends: hashable >=1.3.5.0 && <1.6

if !impl(ghc >=9.0)
if !flag(base-ge-4-15)
build-depends: foldable1-classes-compat >=0.1 && <0.2

if !impl(ghc >=9.2)
if !flag(base-ge-4-16)
build-depends: base-orphans >=0.8.6

-- flag selection forcing conditionals
if flag(base-ge-4-15)
build-depends: base >=4.15

else
build-depends: base <4.15

if flag(base-ge-4-16)
build-depends: base >=4.16

else
build-depends: base <4.16

test-suite instances
type: exitcode-stdio-1.0
default-language: Haskell98
Expand Down
11 changes: 0 additions & 11 deletions src/Data/Tuple/OneTuple.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 708
{-# LANGUAGE PatternSynonyms #-}
#endif
-- | This is a module to help migration from @OneTuple@ to @Solo@.
-- Migrate to use "Data.Tuple" from @base-4.16@ or "Data.Tuple.Solo" with all GHCs.
--
Expand All @@ -10,9 +7,7 @@ module Data.Tuple.OneTuple
{-# DEPRECATED "Use Data.Tuple.Solo" #-}
(
OneTuple,
#if __GLASGOW_HASKELL__ >= 708
pattern OneTuple,
#endif
only,
) where

Expand All @@ -23,13 +18,7 @@ type OneTuple = Solo
only :: OneTuple a -> a
only = getSolo

#if __GLASGOW_HASKELL__ >= 708
#if __GLASGOW_HASKELL__ >= 710
pattern OneTuple :: a -> Solo a
#endif
pattern OneTuple a = MkSolo a
#endif

#if __GLASGOW_HASKELL__ >= 800
{-# COMPLETE OneTuple #-}
#endif
1 change: 1 addition & 0 deletions src/Data/Tuple/Solo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pattern MkSolo a = Solo a

{-# COMPLETE MkSolo #-}

-- !MIN_VERSION_base(4,15,0)
#else

import Control.Applicative (Applicative (..))
Expand Down
5 changes: 0 additions & 5 deletions test/instances.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -Wincomplete-patterns -Werror=incomplete-patterns #-}
#else
{-# OPTIONS_GHC -fwarn-incomplete-patterns -Werror #-}
#endif
module Main where

import Control.Applicative (Applicative (..))
Expand Down Expand Up @@ -66,9 +63,7 @@ hasApplicative :: Applicative f => f a -> f a; hasApplicative x = x; testApplica
hasMonad :: Monad f => f a -> f a; hasMonad x = x; testMonad = hasMonad tup1
hasMonadFix :: MonadFix f => f a -> f a; hasMonadFix x = x; testMonadFix = hasMonadFix tup1

#if MIN_VERSION_base(4,4,0)
hasMonadZip :: MonadZip f => f a -> f a; hasMonadZip x = x; testMonadZip = hasMonadZip tup1
#endif

hasEq1 :: Eq1 f => f a -> f a; hasEq1 x = x; testEq1 = hasEq1 tup1
hasOrd1 :: Ord1 f => f a -> f a; hasOrd1 x = x; testOrd1 = hasOrd1 tup1
Expand Down
Loading