mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-17 13:27:30 +03:00
1.8 KiB
1.8 KiB
The todo
and bug
builtin
todo
and bug
have type a -> b
. They take a message or a value of type a
and crash during runtime displaying a
in ucm.
> todo "implement me later"
Loading changes detected in scratch.u.
✅
scratch.u changed.
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
💔💥
I've encountered a call to builtin.todo with the following
value:
"implement me later"
Stack trace:
todo
#qe5e1lcfn8
> bug "there's a bug in my code"
Loading changes detected in scratch.u.
✅
scratch.u changed.
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
💔💥
I've encountered a call to builtin.bug with the following
value:
"there's a bug in my code"
Stack trace:
bug
#m67hcdcoda
Todo
todo
is useful if you want to come back to a piece of code later but you want your project to compile.
complicatedMathStuff x = todo "Come back and to something with x here"
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
complicatedMathStuff : x -> r
Bug
bug
is used to indicate that a particular branch is not expected to execute.
test = match true with
true -> "Yay"
false -> bug "Wow, that's unexpected"
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
test : Text