Releases: tweag/linear-base
Releases · tweag/linear-base
v0.5.0
Headline changes
- Data.List.Linear.{take,drop} take one list element too many #484
- Remove pull array index (unsafe), add uncons. #475 (sjoerdvisscher)
- Adds missing Data.Num.Linear.* instances for Word, Integer, Natural, Float, Word8/16/32/64 Int8/16/32/64 #467 (Qqwy)
- In scope-passing style: use a
Movable binstead ofUr b(it's fully backward compatible compatible)#473 (aspiwack)
Miscellaneous
v0.4.0
Headline changes
- Deprecate cycle, repeat, and iterate for lists #458 (treeowl)
- Compability with GHC 9.8 #457 (monoidal)
- Drop compatibility with GHC 9.0 #442 (aspiwack)
- Implements
Semigroup/Monoidinstances forUr#461 (konn) - Adds
Functorinstances for the linear arrow #460 (konn)- This fixes an issue with linear lenses (both
DataandControl) #459
- This fixes an issue with linear lenses (both
Miscellaneous
v0.3.1
v0.3
Headline changes
- Support GHC 9.4 in addition to GHC 9.2 and GHC 9.0 (GHC 9.0 is no longer tested though) #427 (matthew-healy)
- Update
shell.nixto enable building with GHC 9.4.1 #429 (matthew-healy)
- Update
- Improvement of the resource-aware
IO(RIO) monad's interface
Miscellaneous
Monoid (Maybe a)requires onlySemigroup a, notMonoid a#409 (treeowl)- Add
evalState(T)#411 (andreasabel) - Add
Movableinstances for several primitive types, as well as (non-linear)Applicative,Foldable,Traversableinstances forV. #416 (sellout) - Fix typo in comment: resrouce -> resource #421 (undergroundquizscene)
- Fix haddock hyperlink reference (minor typo) #420 (undergroundquizscene)
- Fix haddock links in
Data.Replicator.Linear#423 (undergroundquizscene) - Add
CONTRIBUTING.md#426 (tbagrel1)
Internal
v0.2
Breaking changes
- Remove
Prelude.Linear.asTypeOf#397 (tbagrel1) - Add (and use) linear generics for many classes #394 (treeowl)
Control.Functor.Linear.Functor,Data.Functor.Linear.{Functor,Applicative}can now be derived throughGenerically1Data.Functor.Linear.Traversablecannot be derived directly, but one can getgenericTraversefor aGeneric1type and then settraverse = genericTraverseData.Unrestricted.Linear.{Consumable,Dupable,Movable}can be derived throughGenerically
- Rework
Data.Monoid.Linearmodule (affects linearSemigroupandMonoid) #314 (sjoerdvisscher), #381 (tbagrel1)- Remove superclass constraint on
Prelude.{Semigroup,Monoid}forData.Monoid.Linear.{Semigroup,Monoid}.Data.Monoid.Linear.Monoidinstances now have to definemempty - Add many missing instances of
Data.Monoid.Linear.{Semigroup,Monoid} - Deprecate
Data.Monoid.Linear.{Adding,Multiplying,getAdded,getMultiplied}in favor ofData.Semigroup.{Sum,Product}(reexported underData.Monoid.Linear) which now have linearSemigroupandMonoidinstance.SumandProductinner values can be extracted linearly with pattern-matching Data.Semigroupis no longer reexported as a whole underData.Monoid.Linear. Instead, only newtypes with a linearSemigroupinstance are reexported
- Remove superclass constraint on
- Add missing fixity declarations for every operator of
linear-base#386, (tbagrel1)- Unchanged (already present):
infixr 0 $,infixl 1 &,infixr 2 ||,infixr 3 &&,
infix 4 ==, /=, <=, <, >, >=,infixr 5 :> - Add:
infixr 0 `lseq`, `seq`, $! - Add:
infixl 1 <&>, >>=, >>, & - Add:
infixr 3 *** - Add:
infix 4 `compare`, `elem` - Add:
infixl 4 <$>, <$, <*>, <* - Add:
infixr 5 ++ - Add:
infixr 6 <> - Add:
infixl 6 +, - - Add:
infixl 7 * - Add:
infixr 9 #., .>, . - Previously missing fixity declarations defaulted to
infixl 9, so some code might subtly break when updating to v0.2.0
- Unchanged (already present):
- Improve consistency of module naming #383 (tbagrel1)
System.IO.Resource->System.IO.Resource.Linear
- Rework
Data.V.LinearAPI #360 (tbagrel1)Data.Functor.Linear.Applicativeinstanceempty :: forall a. V 0 aconsume :: V 0 a %1 -> ()cons :: forall n a. a %1 -> V (n - 1) a %1 -> V n auncons# :: 1 <= n => V n a %1 -> (# a, V (n - 1) a #)uncons :: 1 <= n => V n a %1 -> (a, V (n - 1) a)elim :: forall (n :: Nat) a b f. IsFunN a b f => f %1 -> V n a %1 -> bmake :: forall (n :: Nat) a f. IsFunN a (V n a) f => ffromReplicator :: forall n a. KnownNat n => Replicator a %1 -> V n atheLength :: forall n. KnownNat n => Prelude.IntdupVis now part ofData.V.Linear:
dupV :: forall n a. (KnownNat n, Dupable a) => a %1 -> V n a
- Replace
dupVin the minimal definition ofData.Unrestricted.Linear.DupablewithdupR :: a %1 -> Replicator a#360 (tbagrel1) #365 (facundominguez)- Introduce a new data type
Data.Replicator.Linear.Replicator, which represents an infinite linear stream producing values of typea, with a stream-like API and aData.Functor.Linear.Applicativeinstance Data.Unrestricted.Linear.Dupableno longer depends onData.V.Linear- Add
dup3,dup4,dup5,dup6,dup7
- Introduce a new data type
- Polymorphise the type of some
Prelude.Linearfunctions in levity and multiplicity #353 (treeowl)($) :: forall {rep} a (b :: TYPE rep) p q. (a %p-> b) %q-> a %p-> b(&) :: forall {rep} a (b :: TYPE rep) p q. a %p-> (a %p-> b) %q-> b($!) :: forall {rep} a (b :: TYPE rep) p q. (a %p-> b) %q-> a %p-> b(.) :: forall {rep} b (c :: TYPE rep) a q m n. (b %1-> c) %q-> (a %1-> b) %m-> a %n-> cforget :: forall {rep} a (b :: TYPE rep). (a %1-> b) %1-> a -> b
- Multiplicity-polymorphise the type of some
Prelude.Linearfunctions #319 (aspiwack)id :: a %q-> aconst :: a %q-> b -> aasTypeOf :: a %q-> a -> aseq :: a -> b %q-> bcurry :: ((a, b) %p-> c) %q-> a %p-> b %p-> cuncurry :: (a %p-> b %p-> c) %q-> (a, b) %p-> crunIdentity' :: Identity a %p-> a
- Remove
LinearArrowusage inControl.Optics.Linearand useFUN 'Oneinstead #308 (sjoerdvisscher)- This change add a
Data.Profunctor.Linear.Profunctorinstance toFUN 'One
- This change add a
- Add
.Linear.Internalmodules (and only export parts of them in publicly-exposed.Linearmodules) #306 (ekmett)Data.Array.Destination[.Internal]Data.Array.Mutable.Linear[.Internal]Data.HashMap.Mutable.Linear[.Internal]Data.Set.Mutable.Linear[.Internal]Data.Vector.Mutable.Linear[.Internal]Foreign.Marshal.Pure[.Internal]System.IO.Resource.Linear.[.Internal]- This principle has been applied for newly-created modules in the subsequent PRs
New additions
- Add
Data.Arity.Linearmodule containing type-level helpers to deal with n-ary linear functions and type-level structural integers #390 (aspiwack), #391 (tbagrel1) - Add
voidfunction to consumeControl.Functor.Linear.Functorinner value #387 (tbagrel1) - Add inspection tests to check inlining of
Data.Replicator.Linear.elimandData.V.Linear.{make,elim}#367 (tbagrel1) - Add
genericTraversetoData.Functor.LinearforGenerics.Linear.Generic1types #366 (tbagrel1), #384 (aspiwack), #385 (treeowl) - Add
Unsafe.toLinearN(and narrow the scope of some coercions in the module internals) #346 (treeowl) - Add newtype
Data.Unrestricted.Linear.AsMovableto deriveConsumableandDupablefromMovable#357 (tbagrel1) - Add
Data.Unrestricted.Linear.{Consumable,Dupable,Moveable}instances for all Word and Int types #352 (googleson78) - Add benchmarks for
Data.HashMap.Linear#338 (utdemir) - Add benchmarks for
Data.Array.Mutable.Linear#331 (utdemir) - Add
Data.Unrestricted.Linear.{Consumable,Dupable}instances toData.V.Linear.V#324 (aspiwack) - Add
Data.Unrestricted.Linear.UrT, the unrestricted monad transformer #304 (sjoerdvisscher)
Code improvements
- Add robustness improvements to
Data.Replicator.Linear.elimandData.V.Linear.{make,elim}#364 (tbagrel1), #382 (tbagrel1), #390 (aspiwack), #391 (tbagrel1) - Add various optimisations for
Data.HashMap.Linear#337 (utdemir) - Improve
Data.Array.Mutable.Unlifted.Linear.mapperformance #334 (utdemir) - Remove one
unsafeCoerceuse fromUnsafe.coerce#330 (utdemir) - Improve
Prelude.Linear.seqperformance #329 (utdemir) - Use safer
Vector.fromArrayinData.Array.Mutable.Linearinternals #327 (utdemir) - Remove some incomplete pattern matches in
Data.List.Linear.{scanr,scanr1}#299 (utdemir)
CI/Tooling improvements
- Move CI tests from the
cabaljob to thestackjob [#398](https://github.com...