1
1
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:
Rob Rix 2019-11-01 14:43:04 -04:00
parent 1c1caac53b
commit 2eb80687ea
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -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)