unison/unison-src/transcripts/todo-bug-builtins.md
Paul Chiusano b7bf12081b
Add Author and License metadata types to builtins (#1228)
* Fix #1056 and add author and license metadata types

* Transcript demonstrating that the codebase is empty at first
2020-02-13 10:59:53 -05:00

679 B

The todo and bug builtin

.> builtins.merge

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 = match true with
    true -> "Yay"
    false -> bug "Wow, that's unexpected"