From 4b0af27dde93746658647af848106292c0c2aa69 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 4 Nov 2019 15:53:54 -0500 Subject: [PATCH] Rename Domain to Intro. --- semantic-analysis/semantic-analysis.cabal | 2 +- .../src/Analysis/{Domain.hs => Intro.hs} | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) rename semantic-analysis/src/Analysis/{Domain.hs => Intro.hs} (64%) diff --git a/semantic-analysis/semantic-analysis.cabal b/semantic-analysis/semantic-analysis.cabal index 4a6d89ecd..145619bba 100644 --- a/semantic-analysis/semantic-analysis.cabal +++ b/semantic-analysis/semantic-analysis.cabal @@ -46,12 +46,12 @@ library Analysis.Carrier.Heap.Monovariant Analysis.Carrier.Heap.Precise Analysis.Concrete - Analysis.Domain Analysis.Effect.Env Analysis.Effect.Heap Analysis.File Analysis.FlowInsensitive Analysis.ImportGraph + Analysis.Intro Analysis.ScopeGraph Analysis.Typecheck Control.Carrier.Fail.WithLoc diff --git a/semantic-analysis/src/Analysis/Domain.hs b/semantic-analysis/src/Analysis/Intro.hs similarity index 64% rename from semantic-analysis/src/Analysis/Domain.hs rename to semantic-analysis/src/Analysis/Intro.hs index 2ae1912bf..07d424078 100644 --- a/semantic-analysis/src/Analysis/Domain.hs +++ b/semantic-analysis/src/Analysis/Intro.hs @@ -1,5 +1,5 @@ {-# LANGUAGE DeriveTraversable, FlexibleContexts, GeneralizedNewtypeDeriving, QuantifiedConstraints, StandaloneDeriving #-} -module Analysis.Domain +module Analysis.Intro ( unit , bool , string @@ -7,7 +7,7 @@ module Analysis.Domain , lam , lams , unlam -, Domain(..) +, Intro(..) ) where import Control.Applicative (Alternative(..)) @@ -18,30 +18,30 @@ import Syntax.Module import Syntax.Scope import Syntax.Term -unit :: (Carrier sig m, Member Domain sig) => m a +unit :: (Carrier sig m, Member Intro sig) => m a unit = send Unit -bool :: (Carrier sig m, Member Domain sig) => Bool -> m a +bool :: (Carrier sig m, Member Intro sig) => Bool -> m a bool = send . Bool -string :: (Carrier sig m, Member Domain sig) => Text -> m a +string :: (Carrier sig m, Member Intro sig) => Text -> m a string = send . String -record :: (Carrier sig m, Member Domain sig) => [(Name, m a)] -> m a +record :: (Carrier sig m, Member Intro sig) => [(Name, m a)] -> m a record fs = send (Record fs) -lam :: (Eq a, Carrier sig m, Member Domain sig) => Maybe Name -> a -> m a -> m a +lam :: (Eq a, Carrier sig m, Member Intro sig) => Maybe Name -> a -> m a -> m a lam u n b = send (Lam u (abstract1 n b)) -lams :: (Eq a, Foldable t, Carrier sig m, Member Domain sig) => t (Maybe Name, a) -> m a -> m a +lams :: (Eq a, Foldable t, Carrier sig m, Member Intro sig) => t (Maybe Name, a) -> m a -> m a lams names body = foldr (uncurry lam) body names -unlam :: (Alternative m, Member Domain sig, RightModule sig) => a -> Term sig a -> m (Maybe Name, a, Term sig a) +unlam :: (Alternative m, Member Intro sig, RightModule sig) => a -> Term sig a -> m (Maybe Name, a, Term sig a) unlam n (Alg sig) | Just (Lam n' b) <- prj sig = pure (n', n, instantiate1 (pure n) b) unlam _ _ = empty -data Domain f a +data Intro f a = Unit | Bool Bool | String Text @@ -49,10 +49,10 @@ data Domain f a | Lam (Maybe Name) (Scope () f a) deriving (Foldable, Functor, Traversable) -deriving instance (Eq a, forall a . Eq a => Eq (f a), Monad f) => Eq (Domain f a) +deriving instance (Eq a, forall a . Eq a => Eq (f a), Monad f) => Eq (Intro f a) deriving instance (Ord a, forall a . Eq a => Eq (f a) - , forall a . Ord a => Ord (f a), Monad f) => Ord (Domain f a) -deriving instance (Show a, forall a . Show a => Show (f a)) => Show (Domain f a) + , forall a . Ord a => Ord (f a), Monad f) => Ord (Intro f a) +deriving instance (Show a, forall a . Show a => Show (f a)) => Show (Intro f a) -- | User-specified and -relevant names.