mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +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(..)
|
||||
, alloc'
|
||||
, bind'
|
||||
, lookupEnv'
|
||||
, Env(..)
|
||||
) 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' 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
|
||||
= Alloc name (addr -> m k)
|
||||
|
Loading…
Reference in New Issue
Block a user