on 494dfdb help sign in
elk/libraries/Debug.elm
36 lines 959 B history raw
1module Debug where
2{-| This library is for investigating bugs or performance problems. It should
3*not* be used in production code.
5@docs log, trace
6-}
8import Graphics.Element (Element)
9import Native.Debug
11{-| Log a tagged value on the developer console, and then return the value.
13 1 + log "number" 1 -- equals 2, logs "number: 1"
14 length (log "start" []) -- equals 0, logs "start: []"
16Notice that `log` is not a pure function! It should *only* be used for
17investigating bugs or performance problems.
18-}
19log : String -> a -> a
20log = Native.Debug.log
22{-| Watch a particular value in the reactive debugger.
23-}
24watch : String -> a -> a
25watch = Native.Debug.watch
27{-| Watch a particular value in the reactive debugger.
28-}
29watchSummary : String -> (a -> b) -> a -> a
30watchSummary = Native.Debug.watchSummary
32{-| Trace an Element over time in the reactive debugger.
33-}
34trace : String -> Element -> Element
35trace = Native.Debug.tracePath