1
0
forked from GitHub/gf-core

fix compilation with older GHC versions

This commit is contained in:
Krasimir Angelov
2022-11-10 19:19:19 +01:00
parent 5ca00ded84
commit 9214f2a074
2 changed files with 9 additions and 1 deletions

View File

@@ -584,11 +584,19 @@ instance Functor ConstValue where
instance Applicative ConstValue where
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 NonExist _ = NonExist
liftA2 f _ NonExist = NonExist
liftA2 f RunTime _ = RunTime
liftA2 f _ RunTime = RunTime
#endif
value2string v = fmap (unwords.snd) (value2string v False [])
where