Copilot-Language/copilot

`copilot-language`: Remove deprecated function `Copilot.Language.Spec.forall`

ivanperez-keera opened this issue · 6 comments

Description

The function Copilot.Language.Spec.forall was deprecated due to the function name not being allowed in newer versions of GHC. An alternative was provided, so the old function is not being used by any part of Copilot.

The original functions was deprecated in Copilot 3.18 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 functions can now be removed.

Type

  • Bug: unused code included in the implementation.

Additional context

  • Issue #470 , addressed in Copilot 3.18, deprecated the function.

Requester

  • Ivan Perez

Method to check presence of bug

Although this is not a bug per se, compiling with GHC >= 9.4 and --ghc-options='-Werror=forall-identifier' produces an error due to including a function called forall, which is not allowed in new versions of GHC.

Expected result

Compiling with GHC >= 9.4 and --ghc-options='-Werror=forall-identifier' produces no compilation errors.

Desired result

Compiling with GHC >= 9.4 and --ghc-options='-Werror=forall-identifier' produces no compilation errors.

Proposed solution

Remove the deprecated function Copilot.Language.Spec.forall, and any references to it. Adjust documentation accordingly, if needed.

Further notes

None.

Change Manager: Confirmed that the issue exists.

Technical Lead: Confirmed that the issue should be addressed.

Technical Lead: Issue scheduled for fixing in Copilot 3.20.

Fix assigned to: @ivanperez-keera.

Implementor: Solution implemented, review requested.

Change Manager: Verified that:

  • Solution is implemented:
    • The code proposed compiles and passes all tests. Details:
      Build log: https://app.travis-ci.com/github/Copilot-Language/copilot/builds/271304852

    • The solution proposed produces the expected result. Details:
      The following Dockerfile installs copilot with the flag --ghc-option="-Werror=forall-identifier", which will throw an error if the function forall is defined anywhere:

      FROM ubuntu:focal
      
      ENV DEBIAN_FRONTEND=noninteractive
      RUN apt-get update
      
      RUN apt-get install --yes libz-dev
      RUN apt-get install --yes git
      
      RUN apt-get install --yes wget
      RUN mkdir -p $HOME/.ghcup/bin
      RUN wget https://downloads.haskell.org/~ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 -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/
      RUN apt-get install --yes curl
      RUN apt-get install --yes gcc g++ make libgmp3-dev
      RUN apt-get install --yes pkg-config
      
      SHELL ["/bin/bash", "-c"]
      
      RUN ghcup install ghc 9.8.2
      RUN ghcup install cabal 3.2
      RUN ghcup set ghc 9.8.2
      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 \
        && cabal v1-install --ghc-option="-Werror=forall-identifier" $NAME/**/ \
        && echo "Success"

      Command (substitute variables based on new path after merge):

      $ docker run -e "REPO=https://github.com/ivanperez-keera/copilot" -e "NAME=copilot" -e "COMMIT=7c8e7dd1691506ee0cbe6079cfe34b7cbeec9f90" -it copilot-verify-518
      
  • Implementation is documented. Details:
    Readme updated to document compatibility with GHC 9.8.
  • Change history is clear.
  • Commit messages are clear.
  • Changelogs are updated.
  • Examples are updated. Details:
    No updates needed.
  • Required version bumps are evaluated. Details:
    Bump needed.

Change Manager: Implementation ready to be merged.