Skip to content

Commit 17b918f

Browse files
Merge branch 'develop-remove-uTypeType'. Close #615.
**Description** The record field `uTypeType`, part of `Copilot.Core.Type.UType`, is 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 field was deprecated in Copilot 4.1 and no messages have been received requesting that it be kept in this library. As per our internal policy of waiting 3 versions from deprecation until a public interface declaration can be removed, this definition can now be removed. **Type** - Management: remove deprecated code. **Additional context** - Issue #484 , addressed in Copilot 4.1, deprecated the definition. **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 field imported does not exist: ``` $ runhaskell <<< 'import Copilot.Core(uTypeType); main = return ()' ``` The following Dockerfile tries to import the deprecated record field, 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**/ \ && ! cabal v1-exec -- runhaskell <<< 'import Copilot.Core(uTypeType); 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-615 ``` **Solution implemented** Remove the deprecated definition `copilot-core:Copilot.Core.Type.uTypeType`. **Further notes** None.
2 parents f16e417 + 3e0b13d commit 17b918f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
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-04-21
2+
* Remove deprecated Copilot.Core.Type.uTypeType. (#615)
3+
14
2025-03-07
25
* Version bump (4.3). (#604)
36
* Fix typo in documentation. (#587)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ instance (Typeable t, Typed t, KnownNat n) => Typed (Array n t) where
289289
simpleType (Array t) = SArray t
290290

291291
-- | A untyped type (no phantom type).
292-
data UType = forall a . Typeable a => UType { uTypeType :: Type a }
293-
{-# DEPRECATED uTypeType "This field is deprecated in Copilot 4.1. Use pattern matching instead." #-}
292+
data UType = forall a . Typeable a => UType (Type a)
294293

295294
instance Eq UType where
296295
UType ty1 == UType ty2 = typeRep ty1 == typeRep ty2

0 commit comments

Comments
 (0)