on master help sign in
src/Idris/ParseHelpers.hs: workaround build failure against ghc-7.8

> [50 of 75] Compiling Idris.ParseHelpers ( src/Idris/ParseHelpers.hs, dist/build/Idris/ParseHelpers.o ) > > src/Idris/ParseHelpers.hs:40:97: > Could not coerce from ‘Monad Parser’ to ‘Monad IdrisInnerParser’ > because the first type argument of ‘Monad’ has role Nominal, > but the arguments ‘Parser’ and ‘IdrisInnerParser’ differ > arising from the coercion of the method ‘notFollowedBy’ from type > ‘forall a. (Monad Parser, Show a) => Parser a -> Parser ()’ to type > ‘forall a. > (Monad IdrisInnerParser, Show a) => > IdrisInnerParser a -> IdrisInnerParser ()’ > Possible fix: > use a standalone 'deriving instance' declaration, > so you can specify the instance context yourself > When deriving the instance for (Parsing IdrisInnerParser) I'm not sure if it's a ghc-7.8.1-rc2 bug or feature. Looks like standalone deriving does not try to infer (too tight) context. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

commit9f93122ba1aa075c2fa1555fea68a6c403697e04 authorSergei Trofimovich <slyfox@gentoo.org> dateMon 3 Mar 2014, 18:47 (13 years ago) parent780a0a6
1 file changed+4−1
src/Idris/ParseHelpers.hs+4−1
src/Idris/ParseHelpers.hs+4−1
@@ -1,4 +1,5 @@
11{-# LANGUAGE GeneralizedNewtypeDeriving, ConstraintKinds, PatternGuards #-}
2+{-# LANGUAGE StandaloneDeriving #-}
23module Idris.ParseHelpers where
34
45import Prelude hiding (pi)
@@ -37,7 +38,9 @@ import System.FilePath
3738type IdrisParser = StateT IState IdrisInnerParser
3839
3940newtype IdrisInnerParser a = IdrisInnerParser { runInnerParser :: Parser a }
40− deriving (Monad, Functor, MonadPlus, Applicative, Alternative, CharParsing, LookAheadParsing, Parsing, DeltaParsing, MarkParsing Delta, Monoid)
41+ deriving (Monad, Functor, MonadPlus, Applicative, Alternative, CharParsing, LookAheadParsing{-, Parsing-}, DeltaParsing, MarkParsing Delta, Monoid)
42+
43+deriving instance Parsing IdrisInnerParser
4144
4245instance TokenParsing IdrisInnerParser where
4346 someSpace = many (simpleWhiteSpace <|> singleLineComment <|> multiLineComment) *> pure ()