Skip to content

Commit 436f198

Browse files
authored
Merge pull request #512 from augustss/master
Make it compile with MicroHs
2 parents e3c5e03 + d025273 commit 436f198

3 files changed

Lines changed: 53 additions & 1 deletion

File tree

.github/workflows/mhs-ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: mhs-ci
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build-mhs-optparse-applicative:
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: checkout mhs repo
15+
uses: actions/checkout@v4
16+
with:
17+
repository: augustss/MicroHs
18+
path: mhs
19+
- name: make and install mhs
20+
run: |
21+
cd mhs
22+
make install
23+
24+
# install dependencies
25+
- name: compile and install packages
26+
run: |
27+
PATH="$HOME/.mcabal/bin:$PATH"
28+
mcabal -q install ghc-compat
29+
mcabal -q install transformers
30+
mcabal -q install colour
31+
mcabal -q install ansi-terminal-types
32+
mcabal -q install ansi-terminal
33+
mcabal -q install --git=https://github.com/augustss/prettyprinter.git --dir=prettyprinter prettyprinter
34+
mcabal -q install --git=https://github.com/augustss/prettyprinter.git --dir=prettyprinter-ansi-terminal prettyprinter-ansi-terminal
35+
36+
# optparse-applicative
37+
- name: checkout optparse-applicative repo
38+
uses: actions/checkout@v4
39+
with:
40+
path: optparse-applicative
41+
- name: compile and install optparse-applicative package
42+
run: |
43+
PATH="$HOME/.mcabal/bin:$PATH"
44+
cd optparse-applicative
45+
mcabal install
46+
47+
- name: cleanup
48+
run: |
49+
rm -rf $HOME/.mcabal

optparse-applicative.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ library
118118
if flag(process)
119119
build-depends: process >= 1.0 && < 1.7
120120

121-
if !impl(ghc >= 8)
121+
if !impl(ghc >= 8) && !impl(mhs)
122122
build-depends: semigroups >= 0.10 && < 0.21
123123
, fail == 4.9.*
124124

src/Options/Applicative/BashCompletion.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
-- | You don't need to import this module to enable bash completion.
23
--
34
-- See
@@ -13,7 +14,9 @@ module Options.Applicative.BashCompletion
1314

1415
import Control.Applicative
1516
import Prelude
17+
#if !defined(__MHS__)
1618
import Data.Foldable ( asum )
19+
#endif
1720
import Data.List ( isPrefixOf )
1821
import Data.Maybe ( fromMaybe, listToMaybe )
1922

0 commit comments

Comments
 (0)