Current section
Files
Jump to
Current section
Files
lib/Control/Process/Dict.hm
-----------------------------------------------------------------------------
-- |
-- Module : Control.Process.Dict
-- Copyright : (c) 2020-2021 EMQ Technologies Co., Ltd.
-- License : BSD-style (see the LICENSE file)
--
-- Maintainer : Feng Lee, feng@emqx.io
-- Yang M, yangm@emqx.io
-- Stability : experimental
-- Portability : portable
--
-- The Process Dictionary module.
--
-----------------------------------------------------------------------------
module Control.Process.Dict where
import Control.Process.Types (Process)
import Data.Maybe (Maybe)
import Data.Unit (Unit)
import Foreign (ffiIO0)
foreign import erase :: forall k v. k -> Process (Maybe v)
-- | Erase all the items in the process dictionary.
foreign import eraseAll :: Process ()
getKeys :: Process [Atom]
getKeys = ffiIO0 :erlang :get_keys
foreign import get :: forall v. Atom -> Process (Maybe v)
foreign import put :: forall v. Atom -> v -> Process (Maybe v)
{- TODO: get() -> [{Key, Val}] -}