Skip to content

Commit

Permalink
Provide a Localhost value
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Feb 9, 2025
1 parent 0765eae commit 07b937e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/nettlesome-core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package nettlesome

import anticipation.*
import contingency.*
import prepositional.*

Expand Down Expand Up @@ -47,6 +48,8 @@ def internet[ResultType](online: Boolean)(block: Internet ?=> ResultType): Resul

def online(using internet: Internet): Boolean = internet.online

val Localhost: Hostname = Hostname(DnsLabel("localhost".tt))

package internetAccess:
given enabled: Online = Online()
given disabled: Tactic[OfflineError] => Online = abort(OfflineError())

0 comments on commit 07b937e

Please sign in to comment.