-- for-loop
nTimes,
+ -- maybe-ish
+ unJust,
+
-- sorting
IF_NOT_GHC(quicksort COMMA stableSortLt COMMA mergesort COMMA)
sortLt,
#include "HsVersions.h"
-import IO ( hPutStrLn, stderr )
import List ( zipWith4 )
+import Maybe ( Maybe(..) )
import Panic ( panic )
import IOExts ( IORef, newIORef, unsafePerformIO )
import FastTypes
nTimes n f = f . nTimes (n-1) f
\end{code}
+%************************************************************************
+%* *
+\subsection{Maybe-ery}
+%* *
+%************************************************************************
+
+\begin{code}
+unJust :: String -> Maybe a -> a
+unJust who (Just x) = x
+unJust who Nothing = panic ("unJust of Nothing, called by " ++ who)
+\end{code}
%************************************************************************
%* *