Skip to content

Commit

Permalink
Changes to whitespace in signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 23, 2025
1 parent bf9611f commit 30ca275
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
26 changes: 13 additions & 13 deletions src/core/turbulence-core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extension [ValueType](value: ValueType)

def writeTo[TargetType](target: TargetType)[ElementType]
(using readable: ValueType is Readable by ElementType, writable: TargetType is Writable by ElementType)
: Unit =
: Unit =

writable.write(target, readable.stream(value))

Expand Down Expand Up @@ -85,7 +85,7 @@ extension [ElementType](stream: LazyList[ElementType])

inline def flow[ResultType](inline termination: => ResultType)
(inline proceed: (head: ElementType, tail: LazyList[ElementType]) ?=> ResultType)
: ResultType =
: ResultType =
stream match
case head #:: tail => proceed(using head, tail)
case _ => termination
Expand All @@ -94,7 +94,7 @@ extension [ElementType](stream: LazyList[ElementType])

def rate[DurationType: GenericDuration: SpecificDuration](duration: DurationType)
(using Monitor, Tactic[AsyncError])
: LazyList[ElementType] =
: LazyList[ElementType] =

def recur(stream: LazyList[ElementType], last: Long): LazyList[ElementType] =
stream.flow(LazyList()):
Expand All @@ -112,7 +112,7 @@ extension [ElementType](stream: LazyList[ElementType])
(active: Boolean,
stream: LazyList[Some[ElementType] | Tap.Regulation],
buffer: List[ElementType])
: LazyList[ElementType] =
: LazyList[ElementType] =

recur(active, stream, buffer)

Expand All @@ -121,7 +121,7 @@ extension [ElementType](stream: LazyList[ElementType])
(active: Boolean,
stream: LazyList[Some[ElementType] | Tap.Regulation],
buffer: List[ElementType])
: LazyList[ElementType] =
: LazyList[ElementType] =

if active && buffer.nonEmpty then buffer.head #:: defer(true, stream, buffer.tail)
else if stream.isEmpty then LazyList()
Expand All @@ -140,12 +140,12 @@ extension [ElementType](stream: LazyList[ElementType])

def cluster[DurationType: GenericDuration](duration: DurationType, maxSize: Optional[Int] = Unset)
(using Monitor)
: LazyList[List[ElementType]] =
: LazyList[List[ElementType]] =

val Limit = maxSize.or(Int.MaxValue)

def recur(stream: LazyList[ElementType], list: List[ElementType], count: Int)
: LazyList[List[ElementType]] =
: LazyList[List[ElementType]] =

count match
case 0 => safely(async(stream.isEmpty).await()) match
Expand All @@ -164,7 +164,7 @@ extension [ElementType](stream: LazyList[ElementType])
LazyList.defer(recur(stream, Nil, 0))

def parallelMap[ElementType2](lambda: ElementType => ElementType2)(using Monitor)
: LazyList[ElementType2] =
: LazyList[ElementType2] =

val out: Spool[ElementType2] = Spool()

Expand Down Expand Up @@ -193,12 +193,12 @@ package lineSeparation:

extension (obj: LazyList.type)
def multiplex[ElemType](streams: LazyList[ElemType]*)(using Monitor)
: LazyList[ElemType] =
: LazyList[ElemType] =

multiplexer(streams*).stream

def multiplexer[ElemType](streams: LazyList[ElemType]*)(using Monitor)
: Multiplexer[Any, ElemType] =
: Multiplexer[Any, ElemType] =

val multiplexer = Multiplexer[Any, ElemType]()
streams.zipWithIndex.map(_.swap).each(multiplexer.add)
Expand Down Expand Up @@ -263,7 +263,7 @@ extension (stream: LazyList[Bytes])
def newArray(): Array[Byte] = new Array[Byte](arbitrary[Double]().toInt.max(1))

def recur(stream: LazyList[Bytes], sourcePos: Int, dest: Array[Byte], destPos: Int)
: LazyList[Bytes] =
: LazyList[Bytes] =

stream match
case source #:: more =>
Expand All @@ -290,7 +290,7 @@ extension (stream: LazyList[Bytes])
def newArray(): Array[Byte] = new Array[Byte](size)

def recur(stream: LazyList[Bytes], sourcePos: Int, dest: Array[Byte], destPos: Int)
: LazyList[Bytes] =
: LazyList[Bytes] =

stream match
case source #:: more =>
Expand Down Expand Up @@ -351,6 +351,6 @@ extension (stream: LazyList[Bytes])
count

def spool[ItemType](using DummyImplicit)[ResultType](lambda: Spool[ItemType] => ResultType)
: ResultType =
: ResultType =
val spool: Spool[ItemType] = Spool()
try lambda(spool) finally spool.stop()
2 changes: 1 addition & 1 deletion src/core/turbulence.Err.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object Err:
def write(bytes: Bytes)(using stdio: Stdio): Unit = stdio.writeErr(bytes)

def print[TextType: Printable as printable](text: Termcap ?=> TextType)(using stdio: Stdio)
: Unit =
: Unit =
stdio.printErr(printable.print(text(using stdio.termcap), stdio.termcap))

def println[TextType: Printable](lines: Termcap ?=> TextType*)(using stdio: Stdio): Unit =
Expand Down
6 changes: 3 additions & 3 deletions src/core/turbulence.LineSeparation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object LineSeparation:
inline def readByte
(inline read: => Byte, next: => Unit, inline mkNewline: => Unit, inline put: Byte => Unit)
(lineSeparators: LineSeparation)
: Unit =
: Unit =

val action: Action = read match
case 10 =>
Expand Down Expand Up @@ -73,8 +73,8 @@ object LineSeparation:

case class LineSeparation
(newline: LineSeparation.NewlineSeq,
cr: LineSeparation.Action,
lf: LineSeparation.Action,
cr: LineSeparation.Action,
lf: LineSeparation.Action,
crlf: LineSeparation.Action,
lfcr: LineSeparation.Action):

Expand Down
2 changes: 1 addition & 1 deletion src/core/turbulence.Out.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object Out:
def write(bytes: Bytes)(using stdio: Stdio): Unit = stdio.write(bytes)

def print[TextType: Printable as printable](text: Termcap ?=> TextType)(using stdio: Stdio)
: Unit =
: Unit =
stdio.print(printable.print(text(using stdio.termcap), stdio.termcap))

def println()(using Stdio): Unit = print("\n".tt)
Expand Down
8 changes: 4 additions & 4 deletions src/core/turbulence.Stdio.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import vacuous.*

object Stdio:
def apply
(out: ji.PrintStream | Null,
err: ji.PrintStream | Null,
in: ji.InputStream | Null,
(out: ji.PrintStream | Null,
err: ji.PrintStream | Null,
in: ji.InputStream | Null,
termcap: Termcap)
: Stdio =
: Stdio =

val safeOut: ji.PrintStream = Optional(out).or(MutePrintStream)
val safeErr: ji.PrintStream = Optional(err).or(MutePrintStream)
Expand Down

0 comments on commit 30ca275

Please sign in to comment.