Skip to content

Commit

Permalink
Renamed Once to Lazy, created by lazily
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Mar 18, 2024
1 parent fe7aa23 commit b6f1133
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/core/collections.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package rudiments

import anticipation.*
import fulminate.*
import vacuous.*

import scala.compiletime.*
Expand Down
6 changes: 6 additions & 0 deletions src/core/rudiments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class Loop(iteration: () => Unit):
synchronized:
state = Loop.State.Finished

def lazily[ValueType](block: => ValueType): Lazy[ValueType]^{block} = new Lazy(() => block)

class Lazy[ValueType](block: () => ValueType):
lazy val value = block()
def apply(): ValueType = value

export Rudiments.&

extension [ProductType <: Product](product: ProductType)(using mirror: Mirror.ProductOf[ProductType])
Expand Down

0 comments on commit b6f1133

Please sign in to comment.