Skip to content

Commit

Permalink
Proper readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KyNorthstar authored May 4, 2018
1 parent 0c64df7 commit b553b7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Swift-Lazy-Patterns
A few lazy patterns for Swift 4
# Swift Lazy Patterns
A few lazy patterns for Swift 4. Note that, if you are OK with the behavior of Swift's `lazy` keyword, you should use that. This is for [those who want very specific behaviors](https://stackoverflow.com/a/40847994/3939277):

* [`Lazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L28-L78): A non-resettable lazy pattern, to guarantee lazy behavior across Swift language versions
* [`ResettableLazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L82-L167): A resettable lazy pattern, whose value is generated and cached only when first needed, and can be destroyed when no longer needed.
* [`FunctionalLazy`](https://github.com/BenLeggiero/Swift-Lazy-Patterns/blob/master/Lazy.swift#L171-L221): An idea about how to approach the lazy pattern by using functions instead of branches.

0 comments on commit b553b7c

Please sign in to comment.