unison/unison-src/transcripts/todo-bug-builtins.md
2019-12-11 10:55:35 -05:00

642 B

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"
> bug "there's a bug in my code"

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"

Bug

bug is used to indicate that a particular branch is not expected to execute.

test = case true of
    true -> "Yay"
    false -> bug "Wow, that's unexpected"