Skip to content

Commit 59fec12

Browse files
Merge branch 'develop-remove-UExpr-fields'. Close #636.
**Description** The record fields `uExprExpr` and `uExprType`, part of `Copilot.Core.Expr`, are never really used within the module or in any other part of Copilot or, as far as we know, by any user of Copilot. The record fields were deprecated in Copilot 4.2 and no messages have been received requesting that they be kept in this library. As per our internal policy of waiting 3 versions from deprecation until a public interface declaration can be removed, these definitions can now be removed. **Type** - Management: remove deprecated code. **Additional context** - Issue #565 , addressed in Copilot 4.2, deprecated the definitions. **Requester** - Ivan Perez **Method to check presence of bug** Not applicable (not a bug). **Expected result** Running the check below prints a message indicating that the fields imported do not exist: ``` $ runhaskell <<< 'import Copilot.Core(uExprType, uExprExpr); main = return ()' ``` The following Dockerfile tries to import the deprecated record fields, succeeding only when the import fails, after which prints the message "Success": ```Dockerfile FROM ubuntu:focal ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install --yes \ libz-dev \ git \ curl \ gcc \ g++ \ make \ libgmp3-dev \ pkg-config \ z3 RUN mkdir -p $HOME/.ghcup/bin RUN curl https://downloads.haskell.org/~ghcup/0.1.40.0/x86_64-linux-ghcup-0.1.40.0 -o $HOME/.ghcup/bin/ghcup RUN chmod a+x $HOME/.ghcup/bin/ghcup ENV PATH=$PATH:/root/.ghcup/bin/ ENV PATH=$PATH:/root/.cabal/bin/ SHELL ["/bin/bash", "-c"] RUN ghcup install ghc 9.10.1 RUN ghcup install cabal 3.2 RUN ghcup set ghc 9.10.1 RUN cabal update SHELL ["/bin/bash", "-c"] CMD git clone $REPO && cd $NAME && git checkout $COMMIT && cd .. \ && cabal v1-sandbox init \ && cabal v1-install alex happy --constraint='happy <= 2' \ && cabal v1-install $NAME/copilot/ \ $NAME/copilot-c99/ \ $NAME/copilot-core/ \ $NAME/copilot-prettyprinter/ \ $NAME/copilot-interpreter/ \ $NAME/copilot-language/ \ $NAME/copilot-libraries/ \ $NAME/copilot-theorem/ \ && ! cabal v1-exec -- runhaskell <<< 'import Copilot.Core(uExprExpr, uExprType); main = return ()' \ && echo "Success" ``` Command (substitute variables based on new path after merge): ``` $ docker run -e "REPO=https://github.com/Copilot-Language/copilot" -e "NAME=copilot" -e "COMMIT=<HASH>" -it copilot-verify-636 ``` **Solution implemented** Remove the deprecated definitions `copilot-core:Copilot.Core.Expr.uExprExpr` and `copilot-core:Copilot.Core.Expr.uExprType`. **Further notes** None.
2 parents 5dd5cd0 + 2f4cc73 commit 59fec12

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

copilot-core/CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2025-06-28
2+
* Remove deprecated fields of Copilot.Core.Expr.UExpr. (#636)
3+
14
2025-05-07
25
* Version bump (4.4). (#618)
36
* Remove deprecated Copilot.Core.Type.uTypeType. (#615)

copilot-core/src/Copilot/Core/Expr.hs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,4 @@ data Expr a where
6767
-- | A untyped expression that carries the information about the type of the
6868
-- expression as a value, as opposed to exposing it at type level (using an
6969
-- existential).
70-
data UExpr = forall a . Typeable a => UExpr
71-
{ uExprType :: Type a
72-
, uExprExpr :: Expr a
73-
}
74-
{-# DEPRECATED uExprType, uExprExpr "These fields are deprecated in Copilot 4.2. Use pattern matching instead." #-}
70+
data UExpr = forall a . Typeable a => UExpr (Type a) (Expr a)

0 commit comments

Comments
 (0)