2{-| This library is for investigating bugs or performance problems. It should
3*not* be used in production code.
9@docs watch, watchSummary, trace
12import Graphics.Element (Element)
16{-| Log a tagged value on the developer console, and then return the value.
18 1 + log "number" 1 -- equals 2, logs "number: 1"
19 length (log "start" []) -- equals 0, logs "start: []"
21Notice that `log` is not a pure function! It should *only* be used for
22investigating bugs or performance problems.
27{-| Crash the program with an error message. This is an uncatchable error,
28intended for code that is soon-to-be-implemented. For example, if you are
29working with a large ADT and have partially completed a case expression, it may
32 data Entity = Ship | Fish | Captain | Seagull
38 _ -> Debug.crash ("drawEntity not implemented for " ++ show entity ++ " yet!")
40Note that incomplete pattern matches are *very* bad practice! They are one of
41the very few ways to crash an Elm program, and they are completely avoidable.
42Production code should not have incomplete pattern matches!
44**Use this if** you want to do some testing while you are partway through
47**Do not use this if** you want to do some typical try-catch exception handling.
48Use the `Maybe` or `Either` libraries instead.
51crash = Native.Error.raise
53{-| Watch a particular value in the reactive debugger.
55watch : String -> a -> a
56watch = Native.Debug.watch
58{-| Watch a particular value in the reactive debugger.
60watchSummary : String -> (a -> b) -> a -> a
61watchSummary = Native.Debug.watchSummary
63{-| Trace an Element over time in the reactive debugger.
65trace : String -> Element -> Element
66trace = Native.Debug.tracePath
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list