-
Notifications
You must be signed in to change notification settings - Fork 36
Make it compile with MicroHs #257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| GNUmakefile | ||
| dist-install/ | ||
| dist-newstyle/ | ||
| dist-mcabal/ | ||
| dist/ | ||
| ghc.mk | ||
| .stack-work/ |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,8 +24,12 @@ import GHC.IO.Encoding.Failure ( CodingFailureMode(..) ) | |||||||||
| import System.OsString.Internal.Types | ||||||||||
| import System.OsPath.Encoding | ||||||||||
| import Control.Monad (when) | ||||||||||
| #if !defined(__MHS__) | ||||||||||
| import System.IO | ||||||||||
| ( TextEncoding ) | ||||||||||
| #else | ||||||||||
| import GHC.IO.Encoding.Types ( TextEncoding ) | ||||||||||
| #endif | ||||||||||
|
|
||||||||||
| #if defined(mingw32_HOST_OS) || defined(__MINGW32__) | ||||||||||
| import qualified System.OsPath.Windows as PF | ||||||||||
|
|
@@ -124,6 +128,7 @@ fromBytes = OS.fromBytes | |||||||||
|
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| #if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter) | ||||||||||
| -- | QuasiQuote an 'OsPath'. This accepts Unicode characters | ||||||||||
| -- and encodes as UTF-8 on unix and UTF-16LE on windows. Runs 'isValid' | ||||||||||
| -- on the input. If used as a pattern, requires turning on the @ViewPatterns@ | ||||||||||
|
|
@@ -159,6 +164,10 @@ osp = QuasiQuoter | |||||||||
| fail "illegal QuasiQuote (allowed as expression or pattern only, used as a declaration)" | ||||||||||
| } | ||||||||||
| #endif | ||||||||||
| #else | ||||||||||
| osp :: a | ||||||||||
| osp = error "Systen.OsPath.Internal.ostr: no Template Haskell" | ||||||||||
| #endif /* defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter) */ | ||||||||||
|
Comment on lines
+169
to
+170
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
|
||||||||||
|
|
||||||||||
| -- | Unpack an 'OsPath' to a list of 'OsChar'. | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |||||||||
|
|
||||||||||
| #include "Common.hs" | ||||||||||
|
|
||||||||||
| #if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter) | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| -- | QuasiQuote a 'PosixPath'. This accepts Unicode characters | ||||||||||
| -- and encodes as UTF-8. Runs 'isValid' on the input. | ||||||||||
| pstr :: QuasiQuoter | ||||||||||
|
|
@@ -29,3 +30,8 @@ pstr = | |||||||||
| , quoteDec = \_ -> | ||||||||||
| fail "illegal QuasiQuote (allowed as expression or pattern only, used as a declaration)" | ||||||||||
| } | ||||||||||
| #else | ||||||||||
| pstr :: a | ||||||||||
| pstr = error "Systen.OsPath.Posix.pstr: no Template Haskell" | ||||||||||
| #endif /* defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter) */ | ||||||||||
|
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |||||||||
|
|
||||||||||
| #include "Common.hs" | ||||||||||
|
|
||||||||||
|
|
||||||||||
| #if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter) | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| -- | QuasiQuote a 'WindowsPath'. This accepts Unicode characters | ||||||||||
| -- and encodes as UTF-16LE. Runs 'isValid' on the input. | ||||||||||
| pstr :: QuasiQuoter | ||||||||||
|
|
@@ -30,3 +30,7 @@ pstr = | |||||||||
| , quoteDec = \_ -> | ||||||||||
| fail "illegal QuasiQuote (allowed as expression or pattern only, used as a declaration)" | ||||||||||
| } | ||||||||||
| #else | ||||||||||
| pstr :: a | ||||||||||
| pstr = error "Systen.OsPath.Windows.pstr: no Template Haskell" | ||||||||||
| #endif /* defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_quoter) */ | ||||||||||
|
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,8 +95,13 @@ library | |
| , bytestring >=0.11.3.0 | ||
| , deepseq | ||
| , exceptions | ||
| , template-haskell | ||
| , os-string >=2.0.1 | ||
| if impl(ghc) | ||
| build-depends: | ||
| template-haskell | ||
| if impl(mhs) | ||
| build-depends: | ||
| ghc-compat | ||
|
Comment on lines
+102
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this isn't necessary anymore? @augustss |
||
|
|
||
| ghc-options: -Wall | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package is called template-haskell-quasiquoter.