projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
External Core: print function types correctly, improve newtype pretty-printing
[ghc-hetmet.git]
/
compiler
/
utils
/
MonadUtils.hs
diff --git
a/compiler/utils/MonadUtils.hs
b/compiler/utils/MonadUtils.hs
index
edce995
..
b1882c3
100644
(file)
--- a/
compiler/utils/MonadUtils.hs
+++ b/
compiler/utils/MonadUtils.hs
@@
-21,7
+21,11
@@
module MonadUtils
-- Detection of available libraries
----------------------------------------------------------------------------------------
-- Detection of available libraries
----------------------------------------------------------------------------------------
+#if __GLASGOW_HASKELL__ >= 606
#define HAVE_APPLICATIVE 1
#define HAVE_APPLICATIVE 1
+#else
+#define HAVE_APPLICATIVE 0
+#endif
-- we don't depend on MTL for now
#define HAVE_MTL 0
-- we don't depend on MTL for now
#define HAVE_MTL 0
@@
-54,6
+58,10
@@
class Functor f => Applicative f where
infixl 4 <$>
infixl 4 <*>
infixl 4 <$>
infixl 4 <*>
+instance Applicative IO where
+ pure = return
+ (<*>) = ap
+
#endif
----------------------------------------------------------------------------------------
#endif
----------------------------------------------------------------------------------------