You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Description**
The type `Copilot.Core.Expr.Tag` was deprecated in Copilot 3.6 because
it was not used and therefore did not belong in the program.
As per our internal policy of waiting 3 versions from deprecation until
a public interface declaration can be removed, this type can now be
removed completely.
**Type**
- Bug: unused code included in the implementation; a type declared does
not have a complete API.
**Additional context**
- Issue: #260.
**Requester**
- Ivan Perez
**Method to check presence of bug**
The following expression finds uses of `Tag`, ignoring appearances in comments or strings.
```sh
$ grep -nHre '\<Tag\>' --include='*.hs' | grep -ve '^{-#' | grep -ve '--.*Tag' | grep -ve '"[^"]*Tag[^"]*"'
copilot-core/src/Copilot/Core/Expr.hs:15: , Tag
copilot-core/src/Copilot/Core/Expr.hs:43:type Tag = Int
```
The result obtained are two lines: the definition, and it being
exported. `Tag`s are not required by Copilot's requirements, and
therefore should not be published.
A complete Dockerfile follows:
```
FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install --yes software-properties-common
RUN add-apt-repository ppa:hvr/ghc
RUN apt-get update
RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4
RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update
RUN cabal v1-sandbox init
RUN cabal v1-install alex happy
RUN apt-get install --yes git
CMD git clone $REPO && cd $NAME && git checkout $COMMIT && set -x && grep -nHre '\<Tag\>' --include='*.hs' | grep -ve '^{-#' | grep -ve '--.*Tag' | grep -ve '"[^"]*Tag[^"]*"
```
It can be executed with:
```
$ docker run -e "REPO=<REPO_URL>" -e "NAME=<DIR>" -e "COMMIT=<TAG_BRANCH_OR_HASH>" -it copilot-verify-304
```
**Expected result**
The string returned by the script should not be empty (no type
exists).
Running the docker image will show nothing after a message if the type
is not present.
```
HEAD is now at <TAG_BRANCH_OR_HASH>
```
**Solution implemented**
This change implementation removes that type declaration from the module
`Copilot.Core.Expr`, as well as its export from the module's export
list.
**Further notes**
See
0f536ec
for a confirmation of when the type was deprecated.
0 commit comments