From 8146b2a91d0d31ad0d7abf04782b221f8abf4d28 Mon Sep 17 00:00:00 2001 From: janmasrovira Date: Wed, 4 May 2022 18:03:59 +0200 Subject: [PATCH] [monojuvix] remove unused constructor ExpressionTyped (#80) --- src/MiniJuvix/Syntax/MicroJuvix/Pretty/Base.hs | 2 -- src/MiniJuvix/Syntax/MonoJuvix/Language.hs | 9 --------- src/MiniJuvix/Syntax/MonoJuvix/Pretty/Base.hs | 4 ---- src/MiniJuvix/Translation/MonoJuvixToMiniHaskell.hs | 1 - 4 files changed, 16 deletions(-) diff --git a/src/MiniJuvix/Syntax/MicroJuvix/Pretty/Base.hs b/src/MiniJuvix/Syntax/MicroJuvix/Pretty/Base.hs index e2fd7d7b6..90ac2af09 100644 --- a/src/MiniJuvix/Syntax/MicroJuvix/Pretty/Base.hs +++ b/src/MiniJuvix/Syntax/MicroJuvix/Pretty/Base.hs @@ -272,8 +272,6 @@ instance PrettyCode ModuleBody where ppCode m = do everything <- mapM ppCode (m ^. moduleStatements) return $ vsep2 everything - where - vsep2 = concatWith (\a b -> a <> line <> line <> b) instance PrettyCode Module where ppCode m = do diff --git a/src/MiniJuvix/Syntax/MonoJuvix/Language.hs b/src/MiniJuvix/Syntax/MonoJuvix/Language.hs index 627a49e61..170f1727b 100644 --- a/src/MiniJuvix/Syntax/MonoJuvix/Language.hs +++ b/src/MiniJuvix/Syntax/MonoJuvix/Language.hs @@ -96,17 +96,10 @@ data Iden | IdenAxiom Name deriving stock (Show) -data TypedExpression = TypedExpression - { _typedType :: Type, - _typedExpression :: Expression - } - deriving stock (Show) - data Expression = ExpressionIden Iden | ExpressionApplication Application | ExpressionLiteral C.LiteralLoc - | ExpressionTyped TypedExpression deriving stock (Show) data Application = Application @@ -164,7 +157,6 @@ makeLenses ''InductiveDef makeLenses ''AxiomDef makeLenses ''ModuleBody makeLenses ''Application -makeLenses ''TypedExpression makeLenses ''InductiveConstructorDef makeLenses ''ConstructorApp makeLenses ''Compile @@ -176,7 +168,6 @@ instance HasAtomicity Expression where atomicity e = case e of ExpressionIden {} -> Atom ExpressionApplication a -> atomicity a - ExpressionTyped t -> atomicity (t ^. typedExpression) ExpressionLiteral l -> atomicity l instance HasAtomicity Function where diff --git a/src/MiniJuvix/Syntax/MonoJuvix/Pretty/Base.hs b/src/MiniJuvix/Syntax/MonoJuvix/Pretty/Base.hs index d9fa8beb6..3bcc59c43 100644 --- a/src/MiniJuvix/Syntax/MonoJuvix/Pretty/Base.hs +++ b/src/MiniJuvix/Syntax/MonoJuvix/Pretty/Base.hs @@ -55,14 +55,10 @@ instance PrettyCode Application where r' <- ppRightExpression appFixity (a ^. appRight) return $ l' <+> r' -instance PrettyCode TypedExpression where - ppCode e = ppCode (e ^. typedExpression) - instance PrettyCode Expression where ppCode = \case ExpressionIden i -> ppCode i ExpressionApplication a -> ppCode a - ExpressionTyped a -> ppCode a ExpressionLiteral l -> return (pretty l) keyword :: Text -> Doc Ann diff --git a/src/MiniJuvix/Translation/MonoJuvixToMiniHaskell.hs b/src/MiniJuvix/Translation/MonoJuvixToMiniHaskell.hs index 2fa820869..2e927f48c 100644 --- a/src/MiniJuvix/Translation/MonoJuvixToMiniHaskell.hs +++ b/src/MiniJuvix/Translation/MonoJuvixToMiniHaskell.hs @@ -184,7 +184,6 @@ goExpression :: Sem r Expression goExpression = \case Mono.ExpressionIden i -> goIden i - Mono.ExpressionTyped t -> goExpression (t ^. Mono.typedExpression) Mono.ExpressionApplication a -> ExpressionApplication <$> goApplication a Mono.ExpressionLiteral l -> return (ExpressionLiteral l)