mirror of
https://github.com/github/semantic.git
synced 2024-12-29 09:55:52 +03:00
Define a smart constructor for Alloc.
This commit is contained in:
parent
7508f9c902
commit
1a48a16a44
@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE DeriveFunctor, DeriveGeneric, ExistentialQuantification, LambdaCase, RankNTypes, StandaloneDeriving #-}
|
||||
{-# LANGUAGE DeriveFunctor, DeriveGeneric, ExistentialQuantification, FlexibleContexts, LambdaCase, RankNTypes, StandaloneDeriving #-}
|
||||
module Analysis.Analysis
|
||||
( Analysis(..)
|
||||
, alloc'
|
||||
, Env(..)
|
||||
) where
|
||||
|
||||
@ -28,6 +29,10 @@ data Analysis term name address value m = Analysis
|
||||
, (...) :: address -> name -> m (Maybe address)
|
||||
}
|
||||
|
||||
alloc' :: (Carrier sig m, Member (Env name addr) sig) => name -> m addr
|
||||
alloc' name = send (Alloc name pure)
|
||||
|
||||
|
||||
data Env name addr m k
|
||||
= Alloc name (addr -> m k)
|
||||
| forall a . Bind name addr (m a) (a -> m k)
|
||||
|
Loading…
Reference in New Issue
Block a user