Skip to content

Commit

Permalink
Check for 'base' version, not for GHC version.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenpanne committed Apr 20, 2018
1 parent c6cd93f commit c55f673
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Data/StateVar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ import Data.IORef
import Data.Typeable
import Foreign.Ptr
import Foreign.Storable
--TODO: We actually want to check for base >= 4.12, but there has been no version bump yet.
#if __GLASGOW_HASKELL__ >= 805
#if MIN_VERSION_base(4,12,0)
import Data.Functor.Contravariant
#endif

Expand Down Expand Up @@ -118,8 +117,7 @@ import Data.Functor.Contravariant
-- permit a very limited range of value assignments, and do not report failure.
data StateVar a = StateVar (IO a) (a -> IO ()) deriving Typeable

--TODO: We actually want to check for base >= 4.12, but there has been no version bump yet.
#if __GLASGOW_HASKELL__ >= 805
#if MIN_VERSION_base(4,12,0)
instance Contravariant SettableStateVar where
contramap f (SettableStateVar k) = SettableStateVar (k . f)
{-# INLINE contramap #-}
Expand Down

0 comments on commit c55f673

Please # to comment.