We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b45cb8a commit d987e13Copy full SHA for d987e13
std/core-extras.kk
@@ -16,6 +16,11 @@ extern import
16
pub fun pretend-not-reachable(?kk-file-line: string): b
17
impossible()
18
19
+pub fun no-effect-top(a: () -> pure a, ?kk-file-line: string): a
20
+ with pretend-no-div
21
+ catch(a) fn(err)
22
+ impossible(err.show)
23
+
24
pub fun list/and(l: list<bool>): bool
25
match l
26
Nil -> True
std/log.kk
@@ -0,0 +1,11 @@
1
+import std/data/linearmap
2
3
+linear effect log
4
+ fun log(name: string, message: string): ()
5
6
+fun with-logs(action: () -> <log|e> ()): e ()
7
+ var logs := LinearMap([])
8
+ with handler
9
+ fun log(name, message)
10
+ logs := logs.set(name, logs.lookup(name).default("") ++ message ++ "\n")
11
+ action()
0 commit comments