Skip to content

Commit

Permalink
Merge pull request #25 from augustss/master
Browse files Browse the repository at this point in the history
Make it compile with MicroHs
  • Loading branch information
gbaz authored Dec 29, 2024
2 parents 4aa6fca + e01825b commit 3ec0654
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 3 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/mhs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: mhs-ci

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

jobs:
build-mhs-malcolm-wallace-universe:
runs-on: ubuntu-latest
steps:

- name: checkout mhs repo
uses: actions/checkout@v4
with:
repository: augustss/MicroHs
ref: stable-3
path: mhs
- name: make and install mhs
run: |
cd mhs
make minstall
- name: checkout time repo
uses: actions/checkout@v4
with:
repository: haskell/time
path: time
- name: compile and install time package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd time
mcabal install
- name: checkout containers repo
uses: actions/checkout@v4
with:
repository: haskell/containers
path: containers
- name: compile and install containers package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd containers/containers
mcabal install
- name: checkout malcolm-wallace-universe repo
uses: actions/checkout@v4
with:
path: malcolm-wallace-universe
- name: compile and install polyparse
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd malcolm-wallace-universe/polyparse-*
mcabal install
- name: compile cpphs
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd malcolm-wallace-universe/cpphs-*
mcabal build
- name: compile hscolour
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd malcolm-wallace-universe/hscolour-*
mcabal build
- name: cleanup
run: |
rm -rf $HOME/.mcabal
1 change: 1 addition & 0 deletions hscolour-1.24.4/HsColour.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ main = do
. ("-annot=ANNOTATIONFILE":)
. map (('-':) . fst)) optionTable
++ " ]\n"
useDefault :: a -> (a -> a) -> [a] -> a
useDefault d f list | null list = d
| otherwise = f (head list)
useDefaults d f list | null list = d
Expand Down
14 changes: 11 additions & 3 deletions polyparse-1.12/polyparse.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,20 @@ source-repository head
location: https://github.com/hackage-trustees/malcolm-wallace-universe.git
subdir: polyparse-1.12

flag base49
description: base >=4.9
default: True
manual: False

library
hs-source-dirs: src
build-depends: base >= 4.3.1.0 && < 5

if !impl(ghc >= 8.0)
build-depends: fail == 4.9.*
if flag(base49)
build-Depends:
base >=4.9 && < 5
else
build-Depends:
base <4.9, fail==4.9.*

exposed-modules:
Text.ParserCombinators.HuttonMeijer,
Expand Down
2 changes: 2 additions & 0 deletions polyparse-1.12/src/Text/ParserCombinators/Poly/Lazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ instance Functor (Parser t) where
fmap f (P p) = P (fmap f p)
instance Monad (Parser t) where
return x = P (return x)
#ifndef __MHS__
fail = Fail.fail
#endif
(P f) >>= g = P (f >>= (\(P g')->g') . g)
instance Fail.MonadFail (Parser t) where
fail e = P (fail e)
Expand Down
2 changes: 2 additions & 0 deletions polyparse-1.12/src/Text/ParserCombinators/Poly/StateLazy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ instance Functor (Parser s t) where
fmap f (P p) = P (fmap f p)
instance Monad (Parser s t) where
return x = P (return x)
#ifndef __MHS__
fail = Fail.fail
#endif
(P f) >>= g = P (f >>= (\(P g')->g') . g)
instance Fail.MonadFail (Parser s t) where
fail e = P (fail e)
Expand Down

0 comments on commit 3ec0654

Please sign in to comment.