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
Merge branch 'develop-remove-ifelse' into develop. Close#150.
**Description**
The dependency on `IfElse` is quite unnecessary: it seems like the only
function we use from that library is `awhen :: Monad m => Maybe a -> (a
-> m ()) -> m ()`, which is a type-specialized version of
[`Data.Foldable.for_`.](https://hackage.haskell.org/package/base-4.20.0.1/docs/Data-Foldable.html#v:for_).
Since the latter is in `base`, we can simplify Ogma by removing the
dependency on `IfElse`.
**Type**
- Management: Reduce technical debt, in compliance with style guide.
**Additional context**
None.
**Requester**
- Ivan Perez
**Method to check presence of bug**
The following dockerfile checks that no cabal package depends on IfElse,
in which case it prints the message "Success":
```Dockerfile
FROM ubuntu:focal
RUN apt-get update
RUN apt-get install --yes git
SHELL ["/bin/bash", "-c"]
CMD git clone $REPO \
&& cd $NAME \
&& git checkout $COMMIT \
&& ! grep -niHre 'IfElse' --include='*.cabal' ogma** \
&& echo "Success"
```
Command (substitute variables based on new path after merge):
```sh
$ docker run -e "REPO=https://github.com/NASA/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=<HASH>" -it ogma-verify-150
```
**Expected result**
Running the dockerfile above prints the message "Success", indicating
that IfElse is not required by any library in ogma.
**Solution implemented**
Replace calls to `awhen`, from IfElse, with calls to `for_`, from
Data.Foldable.
Remove the dependency on IfElse from all cabal files.
**Further notes**
None.
0 commit comments