-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnsafe.purs
More file actions
31 lines (23 loc) · 802 Bytes
/
Unsafe.purs
File metadata and controls
31 lines (23 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module Python.IO.Unsafe
( show
, printLn
, repr
, assertMsg
, assert
)
where
import Prelude
import Effect (Effect)
-- | Equal to `str` in Python but wrapped in Effect monad.
foreign import show :: forall a. a -> Effect String
-- | Equal to `print` in Python but wrapped in Effect monad.
foreign import printLn :: forall a. a -> Effect Unit
-- | Equal to `repr` in Python but wrapped in Effect monad.
foreign import repr :: forall a. a -> Effect String
-- | Equal to `assert cond, msg` in Python but wrapped in Effect monad.
foreign import assertMsg :: Boolean -> String -> Effect Unit
-- | Equal to `assert cond` in Python but wrapped in Effect monad.
foreign import assert_ :: Boolean -> Effect Unit
-- | See `assert_`
assert :: Boolean -> Effect Unit
assert = assert_