projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
catch SIGHUP and SIGTERM and raise an exception (#3656)
[ghc-hetmet.git]
/
compiler
/
utils
/
Util.lhs
diff --git
a/compiler/utils/Util.lhs
b/compiler/utils/Util.lhs
index
16a1628
..
81fc0fe
100644
(file)
--- a/
compiler/utils/Util.lhs
+++ b/
compiler/utils/Util.lhs
@@
-7,7
+7,7
@@
-- | Highly random utility functions
module Util (
-- * Flags dependent on the compiler build
-- | Highly random utility functions
module Util (
-- * Flags dependent on the compiler build
- ghciSupported, debugIsOn, ghciTablesNextToCode, picIsOn,
+ ghciSupported, debugIsOn, ghciTablesNextToCode, isDynamicGhcLib,
isWindowsHost, isWindowsTarget, isDarwinTarget,
-- * General list processing
isWindowsHost, isWindowsTarget, isDarwinTarget,
-- * General list processing
@@
-30,6
+30,9
@@
module Util (
isIn, isn'tIn,
isIn, isn'tIn,
+ -- * Tuples
+ fstOf3, sndOf3, thirdOf3,
+
-- * List operations controlled by another list
takeList, dropList, splitAtList, split,
dropTail,
-- * List operations controlled by another list
takeList, dropList, splitAtList, split,
dropTail,
@@
-138,11
+141,11
@@
ghciTablesNextToCode = True
ghciTablesNextToCode = False
#endif
ghciTablesNextToCode = False
#endif
-picIsOn :: Bool
-#ifdef __PIC__
-picIsOn = True
+isDynamicGhcLib :: Bool
+#ifdef DYNAMIC
+isDynamicGhcLib = True
#else
#else
-picIsOn = False
+isDynamicGhcLib = False
#endif
isWindowsHost :: Bool
#endif
isWindowsHost :: Bool
@@
-181,6
+184,15
@@
nTimes 1 f = f
nTimes n f = f . nTimes (n-1) f
\end{code}
nTimes n f = f . nTimes (n-1) f
\end{code}
+\begin{code}
+fstOf3 :: (a,b,c) -> a
+sndOf3 :: (a,b,c) -> b
+thirdOf3 :: (a,b,c) -> c
+fstOf3 (a,_,_) = a
+sndOf3 (_,b,_) = b
+thirdOf3 (_,_,c) = c
+\end{code}
+
%************************************************************************
%* *
\subsection[Utils-lists]{General list processing}
%************************************************************************
%* *
\subsection[Utils-lists]{General list processing}