mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
fix compilation with older GHC versions
This commit is contained in:
@@ -43,7 +43,7 @@ instance (Monad m,HasPGF m,Fail.MonadFail m) => TypeCheckArg m where
|
|||||||
(inferExpr pgf e)
|
(inferExpr pgf e)
|
||||||
Nothing -> fail "Import a grammar before using this command"
|
Nothing -> fail "Import a grammar before using this command"
|
||||||
|
|
||||||
pgfCommands :: (HasPGF m, MonadFail m) => Map.Map String (CommandInfo m)
|
pgfCommands :: (HasPGF m, Fail.MonadFail m) => Map.Map String (CommandInfo m)
|
||||||
pgfCommands = Map.fromList [
|
pgfCommands = Map.fromList [
|
||||||
("aw", emptyCommandInfo {
|
("aw", emptyCommandInfo {
|
||||||
longname = "align_words",
|
longname = "align_words",
|
||||||
|
|||||||
@@ -584,11 +584,19 @@ instance Functor ConstValue where
|
|||||||
instance Applicative ConstValue where
|
instance Applicative ConstValue where
|
||||||
pure = Const
|
pure = Const
|
||||||
|
|
||||||
|
(Const f) <*> (Const x) = Const (f x)
|
||||||
|
NonExist <*> _ = NonExist
|
||||||
|
_ <*> NonExist = NonExist
|
||||||
|
RunTime <*> _ = RunTime
|
||||||
|
_ <*> RunTime = RunTime
|
||||||
|
|
||||||
|
#if MIN_VERSION_base(4,10,0)
|
||||||
liftA2 f (Const a) (Const b) = Const (f a b)
|
liftA2 f (Const a) (Const b) = Const (f a b)
|
||||||
liftA2 f NonExist _ = NonExist
|
liftA2 f NonExist _ = NonExist
|
||||||
liftA2 f _ NonExist = NonExist
|
liftA2 f _ NonExist = NonExist
|
||||||
liftA2 f RunTime _ = RunTime
|
liftA2 f RunTime _ = RunTime
|
||||||
liftA2 f _ RunTime = RunTime
|
liftA2 f _ RunTime = RunTime
|
||||||
|
#endif
|
||||||
|
|
||||||
value2string v = fmap (unwords.snd) (value2string v False [])
|
value2string v = fmap (unwords.snd) (value2string v False [])
|
||||||
where
|
where
|
||||||
|
|||||||
Reference in New Issue
Block a user