Skip to content

Commit 61be0b8

Browse files
committed
Newtype for pid
1 parent 0380430 commit 61be0b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Node/Process.purs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module Node.Process
1212
, getEnv
1313
, lookupEnv
1414
, setEnv
15+
, Pid(..)
1516
, pid
1617
, platform
1718
, exit
@@ -100,7 +101,12 @@ lookupEnv k = StrMap.lookup k <$> getEnv
100101
-- | Set an environment variable.
101102
foreign import setEnv :: forall eff. String -> String -> Eff (process :: PROCESS | eff) Unit
102103

103-
pid :: Int
104+
newtype Pid = Pid Int
105+
106+
runPid :: Pid -> Int
107+
runPid (Pid x) = x
108+
109+
pid :: Pid
104110
pid = process.pid
105111

106112
platform :: Platform

0 commit comments

Comments
 (0)