mirror of
https://github.com/github/semantic.git
synced 2024-12-26 00:12:29 +03:00
Define a smart constructor for Lookup.
This commit is contained in:
parent
1c1caac53b
commit
2eb80687ea
@ -3,6 +3,7 @@ module Analysis.Analysis
|
|||||||
( Analysis(..)
|
( Analysis(..)
|
||||||
, alloc'
|
, alloc'
|
||||||
, bind'
|
, bind'
|
||||||
|
, lookupEnv'
|
||||||
, Env(..)
|
, Env(..)
|
||||||
) where
|
) where
|
||||||
|
|
||||||
@ -36,6 +37,9 @@ alloc' name = send (Alloc name pure)
|
|||||||
bind' :: (Carrier sig m, Member (Env name addr) sig) => name -> addr -> m a -> m a
|
bind' :: (Carrier sig m, Member (Env name addr) sig) => name -> addr -> m a -> m a
|
||||||
bind' name addr m = send (Bind name addr m pure)
|
bind' name addr m = send (Bind name addr m pure)
|
||||||
|
|
||||||
|
lookupEnv' :: (Carrier sig m, Member (Env name addr) sig) => name -> m (Maybe addr)
|
||||||
|
lookupEnv' name = send (Lookup name pure)
|
||||||
|
|
||||||
|
|
||||||
data Env name addr m k
|
data Env name addr m k
|
||||||
= Alloc name (addr -> m k)
|
= Alloc name (addr -> m k)
|
||||||
|
Loading…
Reference in New Issue
Block a user