Skip to content
Closed
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
59 changes: 59 additions & 0 deletions .github/workflows/mhs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: ci-mhs

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

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

- name: checkout mhs repo
uses: actions/checkout@v4
with:
repository: augustss/MicroHs
ref: stable-6
path: mhs
- name: make and install mhs
run: |
cd mhs
make minstall

- name: checkout transformers repo
uses: actions/checkout@v4
with:
repository: augustss/transformers
path: transformers
- name: compile and install transformers package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd transformers
mcabal install

- name: checkout mtl repo
uses: actions/checkout@v4
with:
repository: augustss/mtl
path: mtl
- name: compile and install mtl package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd mtl
mcabal install

- name: checkout parsec repo
uses: actions/checkout@v4
with:
path: parsec
- name: compile and install parsec package
run: |
PATH="$HOME/.mcabal/bin:$PATH"
cd parsec
mcabal install

- name: cleanup
run: |
rm -rf $HOME/.mcabal
5 changes: 2 additions & 3 deletions parsec.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ library
base >= 4.12.0.0 && < 4.21,
mtl >= 2.2.2 && < 2.4,
bytestring >= 0.10.8.2 && < 0.13,
text (>= 1.2.3.0 && < 1.3)
|| (>= 2.0 && < 2.2)
text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2)

default-language: Haskell2010
other-extensions:
Expand All @@ -86,7 +85,7 @@ library
UndecidableInstances

ghc-options: -Wall
if impl(ghc >= 8.0)
if impl(ghc >= 8.0) || impl(mhs)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I actually dropped the support for pre GHC-8.0, so this conditional's else-branch can be removed. Do you mind?

I'm not sure whether Hackage is using new enough Cabal to accept impl(mhs) .

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You can remove the else branch if you want.

Cabal accepts mhs as a valid compiler now, I believe.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hmm. Maybe the CI is using some older cabal?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cabal accepts mhs as a valid compiler now, I believe.

newer Cabal does. But hackage-server still uses old Cabal, so this change could not be released. (And it might take quite a long time).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

@phadej phadej Jan 4, 2025

Choose a reason for hiding this comment

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

@Bodigrim good to know. But given a thought, if the thing can be written without impl(mhs), it should.

You help me, I help you. I'm sorry, but I don't care about MicroHS, so if I can be unaware I will.

That said, the first moment the CI breaks, I will remove it; so adding CI for microhs is somewhat unnecessary too. I won't put any effort into it.

TL;DR my stance is: GHC is the only compiler out there. The ship for multi-compiler ecosystem has long sailed away.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If there is no support for pre-8.0 GHC then the condition can be simplified and it will work with MicroHs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I started this discussion with saying

I actually dropped the support for pre GHC-8.0, so this conditional's else-branch can be removed. Do you mind?


This left a bad taste. I removed the conditional, so AFAICT this patch has only MonoLocalBinds changes which are relevant.

ghc-options: -Wcompat -Wnoncanonical-monad-instances -Wno-trustworthy-safe
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
Expand Down
8 changes: 7 additions & 1 deletion src/Text/Parsec/Token.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE PolymorphicComponents #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Safe #-}

-----------------------------------------------------------------------------
Expand Down Expand Up @@ -348,7 +349,7 @@ data GenTokenParser s u m
-- > reserved = P.reserved lexer
-- > ...

makeTokenParser :: (Stream s m Char)
makeTokenParser :: forall s m u . (Stream s m Char)
=> GenLanguageDef s u m -> GenTokenParser s u m
{-# INLINABLE makeTokenParser #-}
makeTokenParser languageDef
Expand Down Expand Up @@ -390,6 +391,8 @@ makeTokenParser languageDef
-----------------------------------------------------------
-- Bracketing
-----------------------------------------------------------
parens, braces, angles, brackets
:: forall a. ParsecT s u m a -> ParsecT s u m a
parens p = between (symbol "(") (symbol ")") p
braces p = between (symbol "{") (symbol "}") p
angles p = between (symbol "<") (symbol ">") p
Expand All @@ -400,6 +403,8 @@ makeTokenParser languageDef
dot = symbol "."
colon = symbol ":"

commaSep, semiSep, commaSep1, semiSep1
:: forall a. ParsecT s u m a -> ParsecT s u m [a]
commaSep p = sepBy p comma
semiSep p = sepBy p semi

Expand Down Expand Up @@ -681,6 +686,7 @@ makeTokenParser languageDef
symbol name
= lexeme (string name)

lexeme :: forall a. ParsecT s u m a -> ParsecT s u m a
lexeme p
= do{ x <- p; whiteSpace; return x }

Expand Down