Skip to content

Commit 04c8c28

Browse files
committed
chore: remove useless comments
1 parent 8b35655 commit 04c8c28

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

tests/lean/run/async_dns.lean

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ open Std.Net
77

88
open Std.Net
99

10-
-- Using this function to create IO Error. For some reason the assert! is not pausing the execution.
1110
def assertBEq [BEq α] [ToString α] (actual expected : α) : IO Unit := do
1211
unless actual == expected do
1312
throw <| IO.userError <|
1413
s!"expected '{expected}', got '{actual}'"
1514

16-
-- Define the Async monad
1715
structure Async (α : Type) where
1816
run : IO (AsyncTask α)
1917

2018
namespace Async
2119

22-
-- Monad instance for Async
2320
instance : Monad Async where
2421
pure x := Async.mk (pure (AsyncTask.pure x))
2522
bind ma f := Async.mk do
@@ -53,14 +50,12 @@ def timeout (a : AsyncTask α) (time : Std.Time.Millisecond.Offset) : IO (AsyncT
5350
| .ok res => Task.pure (.ok res)
5451
| .error _ => Task.pure (.error (IO.userError "Timeout."))
5552

56-
-- Await function to simplify AsyncTask handling
5753
def await (task : IO (AsyncTask α)) : Async α :=
5854
Async.mk task
5955

6056
instance : MonadLift IO Async where
6157
monadLift io := Async.mk (io >>= (pure ∘ AsyncTask.pure))
6258

63-
/-- Joe is another client. -/
6459
def runDNS : Async Unit := do
6560
let infos ← await <| (timeout (← DNS.getAddrInfo "google.com" "http") 10000)
6661

0 commit comments

Comments
 (0)