packages feed

linear-base 0.3.0 → 0.3.1

raw patch · 13 files changed

+112/−64 lines, 13 filesdep ~base

Dependency ranges changed: base

Files

CHANGELOG.md view
@@ -1,5 +1,13 @@ # Change Log +## [v0.3.1](https://github.com/tweag/linear-base/tree/v0.3.1) (2023-03-17)++[Full Changelog](https://github.com/tweag/linear-base/compare/v0.3.0...v0.3.1)++### Headline changes++- Support for GHC 9.6 [\#438](https://github.com/tweag/linear-base/pull/438) ([aspiwack](https://github.com/aspiwack) & [guibou](https://github.com/guibou))+ ## [v0.3.0](https://github.com/tweag/linear-base/tree/v0.3.0) (2022-10-26)  [Full Changelog](https://github.com/tweag/linear-base/compare/v0.2.0...v0.3.0)
− ghc92/Prelude/Linear/Internal/Generically.hs
@@ -1,26 +0,0 @@--- | Prior to GHC 9.4, linear-base defined its own versions of @Generically@ and--- @Generically1@. As a temporary workaround to enable compilation on both GHC--- 9.4 and 9.2, this module exposes linear-base's own implementations of those--- types, while the 9.4 version simply re-exports @Generics.Linear@.-module Prelude.Linear.Internal.Generically-  ( Generically (..),-    Generically1 (..),-    module Generics.Linear,-  )-where--import Generics.Linear---- | A datatype whose instances are defined generically, using the--- 'Generics.Linear.Generic' representation.--- Generic instances can be derived via @'Generically' A@ using--- @-XDerivingVia@.-newtype Generically a = Generically a---- | A type whose instances are defined generically, using the--- 'Generics.Linear.Generic1' representation. 'Generically1' is a higher-kinded--- version of 'Generically'.------ Generic instances can be derived for type constructors via--- @'Generically1' F@ using @-XDerivingVia@.-newtype Generically1 f a = Generically1 (f a)
− ghc92/Prelude/Linear/Internal/TypeEq.hs
@@ -1,8 +0,0 @@--- | As of GHC 9.4, @~@ is a type operator exported from `Data.Type.Equality`--- rather than a language construct. As a temporary workaround to enable--- compilation on both GHC 9.4 and 9.2, this module is empty, while the GHC--- 9.4 version re-exports the new type  operator. As a result, files which--- depend on this module will likely have -Wno-unused-imports enabled (and--- potentially also -Wno-dodgy exports if they re-export it). These should be--- removed once support for GHC 9.2 is dropped.-module Prelude.Linear.Internal.TypeEq where
− ghc94/Prelude/Linear/Internal/Generically.hs
@@ -1,10 +0,0 @@--- | Prior to GHC 9.4, linear-base defined its own versions of `Generically` and--- `Generically1`. As a temporary workaround to enable compilation on both--- GHC 9.4 and 9.2, this module simply re-exports Generics.Linear, while the--- 9.2 version exposes linear-base's own implementations.-module Prelude.Linear.Internal.Generically-  ( module Generics.Linear,-  )-where--import Generics.Linear
− ghc94/Prelude/Linear/Internal/TypeEq.hs
@@ -1,16 +0,0 @@-{-# LANGUAGE TypeOperators #-}-{-# LANGUAGE NoImplicitPrelude #-}---- | As of GHC 9.4, @~@ is a type operator exported from `Data.Type.Equality`--- rather than a language construct. As a temporary workaround to enable--- compilation on both GHC 9.4 and 9.2, this module re-exports the new type--- operator, while the 9.2 version is empty. As a result, files which depend--- on this module will likely have -Wno-unused-imports enabled (and potentially--- also -Wno-dodgy exports if they re-export it). These should be removed once--- support for GHC 9.2 is dropped.-module Prelude.Linear.Internal.TypeEq-  ( type (~),-  )-where--import Data.Type.Equality (type (~))
linear-base.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               linear-base-version:            0.3.0+version:            0.3.1 license:            MIT license-file:       LICENSE copyright:          (c) Tweag Holding and affiliates@@ -79,6 +79,7 @@         Data.Set.Mutable.Linear         Data.Set.Mutable.Linear.Internal         Data.Tuple.Linear+        Data.Tuple.Linear.Compat         Data.Unrestricted.Linear         Data.Unrestricted.Linear.Internal.Consumable         Data.Unrestricted.Linear.Internal.Dupable@@ -120,9 +121,13 @@      hs-source-dirs:   src     if impl(ghc >= 9.4.0)-        hs-source-dirs: ghc94+        hs-source-dirs: src-version-changes/ghc94/after     else-        hs-source-dirs: ghc92+        hs-source-dirs: src-version-changes/ghc94/before+    if impl(ghc >= 9.6.0)+        hs-source-dirs: src-version-changes/ghc96/after+    else+        hs-source-dirs: src-version-changes/ghc96/before      default-language: Haskell2010     build-depends:
+ src-version-changes/ghc94/after/Prelude/Linear/Internal/Generically.hs view
@@ -0,0 +1,10 @@+-- | Prior to GHC 9.4, linear-base defined its own versions of `Generically` and+-- `Generically1`. As a temporary workaround to enable compilation on both+-- GHC 9.4 and 9.2, this module simply re-exports Generics.Linear, while the+-- 9.2 version exposes linear-base's own implementations.+module Prelude.Linear.Internal.Generically+  ( module Generics.Linear,+  )+where++import Generics.Linear
+ src-version-changes/ghc94/after/Prelude/Linear/Internal/TypeEq.hs view
@@ -0,0 +1,16 @@+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE NoImplicitPrelude #-}++-- | As of GHC 9.4, @~@ is a type operator exported from `Data.Type.Equality`+-- rather than a language construct. As a temporary workaround to enable+-- compilation on both GHC 9.4 and 9.2, this module re-exports the new type+-- operator, while the 9.2 version is empty. As a result, files which depend+-- on this module will likely have -Wno-unused-imports enabled (and potentially+-- also -Wno-dodgy exports if they re-export it). These should be removed once+-- support for GHC 9.2 is dropped.+module Prelude.Linear.Internal.TypeEq+  ( type (~),+  )+where++import Data.Type.Equality (type (~))
+ src-version-changes/ghc94/before/Prelude/Linear/Internal/Generically.hs view
@@ -0,0 +1,26 @@+-- | Prior to GHC 9.4, linear-base defined its own versions of @Generically@ and+-- @Generically1@. As a temporary workaround to enable compilation on both GHC+-- 9.4 and 9.2, this module exposes linear-base's own implementations of those+-- types, while the 9.4 version simply re-exports @Generics.Linear@.+module Prelude.Linear.Internal.Generically+  ( Generically (..),+    Generically1 (..),+    module Generics.Linear,+  )+where++import Generics.Linear++-- | A datatype whose instances are defined generically, using the+-- 'Generics.Linear.Generic' representation.+-- Generic instances can be derived via @'Generically' A@ using+-- @-XDerivingVia@.+newtype Generically a = Generically a++-- | A type whose instances are defined generically, using the+-- 'Generics.Linear.Generic1' representation. 'Generically1' is a higher-kinded+-- version of 'Generically'.+--+-- Generic instances can be derived for type constructors via+-- @'Generically1' F@ using @-XDerivingVia@.+newtype Generically1 f a = Generically1 (f a)
+ src-version-changes/ghc94/before/Prelude/Linear/Internal/TypeEq.hs view
@@ -0,0 +1,8 @@+-- | As of GHC 9.4, @~@ is a type operator exported from `Data.Type.Equality`+-- rather than a language construct. As a temporary workaround to enable+-- compilation on both GHC 9.4 and 9.2, this module is empty, while the GHC+-- 9.4 version re-exports the new type  operator. As a result, files which+-- depend on this module will likely have -Wno-unused-imports enabled (and+-- potentially also -Wno-dodgy exports if they re-export it). These should be+-- removed once support for GHC 9.2 is dropped.+module Prelude.Linear.Internal.TypeEq where
+ src-version-changes/ghc96/after/Data/Tuple/Linear/Compat.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE LinearTypes #-}++module Data.Tuple.Linear.Compat where++import Data.Tuple++-- | The 'Solo' data constructor was renamed to 'MkSolo' in GHC 9.6 (see+-- [#437](https://github.com/tweag/linear-base/issues/437)). Because at present+-- there is no linear pattern synonym, and in order to stay compatible with GHC+-- 9.4 we use a constructor and a destructor functions as a workaround (it's+-- quite easy in the case of 'Solo' anyway).+unSolo :: Solo a %p -> a+unSolo (MkSolo a) = a++-- | See 'unSolo'.+mkSolo :: a %p -> Solo a+mkSolo = MkSolo
+ src-version-changes/ghc96/before/Data/Tuple/Linear/Compat.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE LinearTypes #-}++module Data.Tuple.Linear.Compat where++import Data.Tuple++-- | The 'Solo' data constructor was renamed to 'MkSolo' in GHC 9.6 (see+-- [#437](https://github.com/tweag/linear-base/issues/437)). Because at present+-- there is no linear pattern synonym, and in order to stay compatible with GHC+-- 9.4 we use a constructor and a destructor functions as a workaround (it's+-- quite easy in the case of 'Solo' anyway).+unSolo :: Solo a %p -> a+unSolo (Solo a) = a++-- | See 'unSolo'.+mkSolo :: a %p -> Solo a+mkSolo = Solo
src/Data/Monoid/Linear/Internal/Semigroup.hs view
@@ -47,6 +47,7 @@     Sum (..),   ) import qualified Data.Semigroup as Prelude+import qualified Data.Tuple.Linear.Compat as Tuple import Data.Unrestricted.Linear.Internal.Consumable (Consumable, lseq) import Data.Void (Void) import GHC.Tuple@@ -165,7 +166,7 @@   Just x <> Just y = Just (x <> y)  instance Semigroup a => Semigroup (Solo a) where-  Solo x <> Solo y = Solo (x <> y)+  x <> y = Tuple.mkSolo (Tuple.unSolo x <> Tuple.unSolo y)  -- See Data.List.Linear for instance ... => Semigroup [a]