Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/mhs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: mhs-ci

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build-mhs-prettyprinter:
runs-on: ubuntu-latest
steps:

- name: checkout mhs repo
uses: actions/checkout@v4
with:
repository: augustss/MicroHs
ref: v0.14.27.0
path: mhs
- name: make and install mhs
run: |
cd mhs
make minstall
Comment on lines +20 to +23

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: make and install mhs
run: |
cd mhs
make minstall
- name: make and install mhs
run: |
cd mhs
make minstall
echo "$HOME/.mcabal/bin" >> "$GITHUB_PATH"

This way, we can avoid having to do PATH="$HOME/.mcabal/bin:$PATH" every time.

# prettyprinter
- name: checkout prettyprinter repo
uses: actions/checkout@v4
with:
path: prettyprinter

- name: compile and install prettyprinter package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd prettyprinter/prettyprinter
mcabal -r install
- name: compile and install prettyprinter-ansi-terminal package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd prettyprinter/prettyprinter-ansi-terminal
mcabal -r install
- name: compile and install prettyprinter-compat-annotated-wl-pprint package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd prettyprinter/prettyprinter-compat-annotated-wl-pprint
mcabal -r install
- name: compile and install prettyprinter-compat-ansi-wl-pprint package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd prettyprinter/prettyprinter-compat-ansi-wl-pprint
mcabal -r install
- name: compile and install prettyprinter-compat-wl-pprint package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd prettyprinter/prettyprinter-compat-wl-pprint
mcabal -r install
- name: cleanup
run: |
rm -rf $HOME/.mcabal
2 changes: 1 addition & 1 deletion misc/version-compatibility-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-- purpose much clearer than just demanding a specific version of a library.

#define APPLICATIVE_MONAD MIN_VERSION_base(4,8,0)
#define FOLDABLE_TRAVERSABLE_IN_PRELUDE MIN_VERSION_base(4,8,0)
#define FOLDABLE_TRAVERSABLE_IN_PRELUDE (MIN_VERSION_base(4,8,0) && !defined(__MHS__))
#define FUNCTOR_IDENTITY_IN_BASE MIN_VERSION_base(4,8,0)
#define MONOID_IN_PRELUDE MIN_VERSION_base(4,8,0)
#define NATURAL_IN_BASE MIN_VERSION_base(4,8,0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ library

if impl(ghc >= 8.0)
ghc-options: -Wcompat
if !impl(ghc >= 8.0)
if !impl(ghc >= 8.0) && !impl(mhs)
build-depends: semigroups >= 0.1

test-suite doctest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ library
, prettyprinter >= 1.7.0
, prettyprinter-ansi-terminal >= 1.1

if !impl(ghc >= 8.0)
if !impl(ghc >= 8.0) && !impl(mhs)
build-depends: semigroups >= 0.1
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ library
, text >= 1.2
, prettyprinter >= 1.7.0

if !impl(ghc >= 8.0)
if !impl(ghc >= 8.0) && !impl(mhs)
build-depends: semigroups >= 0.1
9 changes: 5 additions & 4 deletions prettyprinter/prettyprinter.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,18 @@ library
, Data.Text.Lazy
, Data.Text.Lazy.Builder

if !impl(ghc >= 7.6)
if !impl(ghc >= 7.6) && !impl(mhs)
build-depends: ghc-prim

if impl(ghc >= 8.0)
ghc-options: -Wcompat
if !impl(ghc >= 8.0)
if !impl(ghc >= 8.0) && !impl(mhs)
build-depends: semigroups >= 0.17
build-depends: fail >= 4.9.0.0 && <4.10
if !impl(ghc >= 7.10)
if !impl(ghc >= 7.10) && !impl(mhs)
build-depends: void >=0.4 && <0.8

if impl(mhs)
cpp-options: -DFOLDABLE_TRAVERSABLE_IN_PRELUDE=0
Comment on lines +93 to +94
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand why this is necessary. Doesn't your modification of misc/version-compatibility-macros.h ensure that this variable is set correctly?!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. I'll fix it tomorrow.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. I'll fix it tomorrow.



Flag buildReadme
Expand Down
2 changes: 1 addition & 1 deletion prettyprinter/src/Prettyprinter/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ import Numeric.Natural
#if !(FOLDABLE_TRAVERSABLE_IN_PRELUDE)
import Data.Foldable (Foldable (..))
import Data.Traversable (Traversable (..))
import Prelude hiding (foldr, foldr1)
import Prelude hiding (null, foldr, foldr1)
#endif

#if FUNCTOR_IDENTITY_IN_BASE
Expand Down
Loading