File tree Expand file tree Collapse file tree 2 files changed +45
-24
lines changed Expand file tree Collapse file tree 2 files changed +45
-24
lines changed Original file line number Diff line number Diff line change 15
15
fprintUnsafe :: forall a. a -> a
16
16
17
17
18
+ ## Module Debug.Spy
19
+
20
+ ### Values
21
+
22
+ spy :: forall a. (Show a) => a -> a
23
+
24
+
18
25
## Module Debug.Foreign.Eval
19
26
20
27
### Types
Original file line number Diff line number Diff line change 1
1
module Debug.Foreign where
2
2
3
- import Control.Monad.Eff
4
- import Debug.Trace
3
+ import Control.Monad.Eff
4
+ import Debug.Trace
5
5
6
- foreign import fprint " " "
7
- function fprint(x){
8
- return function(){
6
+ foreign import fprint " " "
7
+ function fprint(x){
8
+ return function(){
9
+ console.log(x);
10
+ return x;
11
+ };
12
+ }
13
+ " " " :: forall a e. a -> Eff (trace :: Trace | e ) a
14
+
15
+ foreign import fprintUnsafe " " "
16
+ function fprintUnsafe(x){
9
17
console.log(x);
10
18
return x;
11
- };
12
- }
13
- " " " :: forall a e . a -> Eff (trace :: Trace | e ) a
14
-
15
- foreign import fprintUnsafe " " "
16
- function fprintUnsafe(x){
17
- console.log(x);
18
- return x;
19
- }
20
- " " " :: forall a . a -> a
21
-
22
- foreign import fprintStringify " " "
23
- function fprintStringify(x){
24
- console.log(JSON.stringify(x));
25
- return x;
26
- }
27
- " " " :: forall a e . a -> Eff (trace :: Trace | e ) a
28
-
29
- fspy = fprintUnsafe
19
+ }
20
+ " " " :: forall a. a -> a
21
+
22
+ foreign import fprintStringify " " "
23
+ function fprintStringify(x){
24
+ console.log(JSON.stringify(x));
25
+ return x;
26
+ }
27
+ " " " :: forall a e. a -> Eff (trace :: Trace | e ) a
28
+
29
+ fspy = fprintUnsafe
30
+
31
+ module Debug.Spy (spy ) where
32
+
33
+ foreign import _spy " " "
34
+ function _spy(s){
35
+ return function(x){
36
+ console.log(s);
37
+ return x;
38
+ };
39
+ }
40
+ " " " :: forall a . String -> a -> a
41
+
42
+ spy :: forall a . (Show a ) => a -> a
43
+ spy x = _spy (show x) x
You can’t perform that action at this time.
0 commit comments