Skip to content

Releases: RougeWare/Swift-Lazy-Containers

4.1 – Autoconformance to synthesized protocols!

06 Jun 23:22
360a35c
Compare
Choose a tag to compare

Now, lazy containers automatically gain conformance to these protocols when their Value also conforms to them:

  • Equatable
  • Hashable
  • Encodable
  • Decodable

This means that every @Lazy, @ResettableLazy, and @FunctionalLazy field is automatically and transparently made to conform to these just like if they were not lazy!

Important: In order to do this, of course, the value will have to be evaluated. That is, if your @Lazy Hashable field is not yet initialized when you want to get its hash value, then it's automatically initialized first.

4.0.0 - Fixed a breaking bug with @Lazy

02 Aug 05:57
6981fb1
Compare
Choose a tag to compare

Thanks to Gabe Shahbazian for reporting this bug. This seems to have been a symptom of a lower-level bug in Swift <5.3, where it would not properly wrap @autoclosure arguments for property wrappers. Sadly, the only "fix" I could find was to prevent the @Lazy property wrapper from being used in Swift <5.3. If you need to use Swift 5.2 or earlier, you can still use the old style:

// In Swift 5.2.x and earlier
let expensive = Lazy<Expensive> { ExpenseFactory.next() }

// In Swift 5.3 and newer
@Lazy
var expensive = ExpenseFactory.next()

Because this causes anyone using @Lazy property wrappers in Swift <5.3 to see compiler errors where there were none previously, this is a Major version increment.

3.1.2 - Updated licensing

22 Jul 02:51
77d063c
Compare
Choose a tag to compare
  • Split the license into two, one special for certain entities, and the other for everyone else
  • Upgraded the license for everyone else from BH-0-PD to BH-1-PS. This means that, if this license applies to you, then you must provide attribution when using this package, among other requirements and restrictions.

Patch Changes

  • 3.1.2
    • Added alternative dynamic library product
  • 3.1.1
    • Updated header comment in LazyContainers.swift

3.0.2 - Typo fix in Readme

24 Oct 05:26
df59ce2
Compare
Choose a tag to compare

Thanks to Brandon Starcheus for fixing this with #15.


See the release notes for 3.0.1 for important changes since 2.x and 1.x.

3.0.1 - Swift 5.1 Package (again)

31 Aug 05:17
20ae92c
Compare
Choose a tag to compare

Resolved some assumptions about Swift Package Manager and updated to yet another Swift 5.1 beta syntax.

Important changes since 2.x are listed in the readme: 84c7de0#diff-04c6e90faac2675aa89e2176d2eec7d8
Important changes since 1.x are listed here: https://github.com/RougeWare/Swift-Lazy-Patterns/releases/tag/2.0.0

With the 3.0.0 release, this package will no longer be distributed as a binary. Please consume this as a Swift Package and compile it as a part of your build process.

2.0.0 - Swift 5.1 Package

11 Aug 22:02
82d72fc
Compare
Choose a tag to compare

New Features

  • Rebranded to Lazy Containers, since this repo focuses on providing containers that lazily hold values, but doesn't focus providing patterns for how to do this (although, it does provide the tools to do that).
  • You can now use Lazy, ResettableLazy, and FunctionalLazy as property wrappers!
  • FunctionalLazy is now passed by value, rather than by reference.
  • You can still lazily initialize the value held within a Lazy, ResettableLazy, nor a FunctionalLazy in a non-mutating way, but you can no longer manually set it. This remains consistent with the goal of this repo (to provide a way to lazily initialize a value). In order to set a value-passed instance in a non-mutating way, see Swift-Safe-Pointer.
  • You can now create an instance of any lazy container with a value already initialized inside it. This is useful when you need a uniform API (for instance, when implementing a protocol that requires a Lazy), but require it to already hold a value up-front.
  • Added repo format which allows this to be a Swift Package.
  • Added unit tests to continue proving stability.

1.1.1

02 Oct 23:19
Compare
Choose a tag to compare
Merge branch 'feature/license/mit'

1.1.0

04 May 19:40
6a5c1da
Compare
Choose a tag to compare
Updated for version 1.1.0

1.0.0

04 May 19:40
b553b7c
Compare
Choose a tag to compare
Proper readme