* included in the distribution.
*
* $RCSfile: connect.h,v $
- * $Revision: 1.16 $
- * $Date: 1999/11/17 16:57:38 $
+ * $Revision: 1.17 $
+ * $Date: 1999/11/23 15:12:10 $
* ------------------------------------------------------------------------*/
/* --------------------------------------------------------------------------
extern String hugsPath; /* String for file search path */
extern String projectPath; /* String for project search path */
+extern Type typeProgIO; /* For the IO monad, IO a */
extern Type typeArrow; /* Builtin type constructors */
extern Type typeList;
extern Type typeUnit;
* included in the distribution.
*
* $RCSfile: hugs.c,v $
- * $Revision: 1.22 $
- * $Date: 1999/11/23 09:59:38 $
+ * $Revision: 1.23 $
+ * $Date: 1999/11/23 15:12:09 $
* ------------------------------------------------------------------------*/
#include <setjmp.h>
main after loading scripts. Useful for running the nofib suite. */
if (argc > 1 && (strcmp(argv[1],"+Q") == 0 || strcmp(argv[1],"-Q")==0)) {
autoMain = TRUE;
- hugsEnableOutput(0);
+ if (strcmp(argv[1],"-Q") == 0) {
+ hugsEnableOutput(0);
+ }
}
Printf("__ __ __ __ ____ ___ _________________________________________\n");
#endif
#if 1
- if (typeMatches(type,ap(typeIO,typeUnit))) {
+ if (isProgType(ks,bd)) {
inputExpr = ap(nameRunIO,inputExpr);
evalExp();
Putchar('\n');
prelCleanupAfterRunAction = primRunST (newIORef Nothing)
-- used when Hugs invokes top level function
-primRunIO_hugs_toplevel :: IO () -> ()
+primRunIO_hugs_toplevel :: IO a -> ()
primRunIO_hugs_toplevel m
= protect 5 (fst (unST composite_action realWorld))
where
composite_action
= do writeIORef prelCleanupAfterRunAction Nothing
- m
+ m
cleanup_handles <- readIORef prelCleanupAfterRunAction
case cleanup_handles of
Nothing -> return ()
* included in the distribution.
*
* $RCSfile: link.c,v $
- * $Revision: 1.16 $
- * $Date: 1999/11/22 16:00:22 $
+ * $Revision: 1.17 $
+ * $Date: 1999/11/23 15:12:08 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
Cell predIntegral; /* Integral (mkOffset(0)) */
Kind starToStar; /* Type -> Type */
Cell predMonad; /* Monad (mkOffset(0)) */
+Type typeProgIO; /* IO a */
/* --------------------------------------------------------------------------
*
predFractional = ap(classFractional,aVar);
predIntegral = ap(classIntegral,aVar);
predMonad = ap(classMonad,aVar);
+ typeProgIO = ap(typeIO,aVar);
}
Void linkPreludeCM(void) { /* Hook to cfuns and mfuns in */
* included in the distribution.
*
* $RCSfile: subst.c,v $
- * $Revision: 1.8 $
- * $Date: 1999/11/17 16:57:49 $
+ * $Revision: 1.9 $
+ * $Date: 1999/11/23 15:12:07 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
return result;
}
-
+Bool isProgType(ks,type) /* Test if type is of the form */
+List ks; /* IO t for some t. */
+Type type; {
+ Bool result;
+ Int alpha;
+ Int beta;
+ emptySubstitution();
+ alpha = newKindedVars(ks);
+ beta = newTyvars(1);
+ bindOnlyAbove(beta);
+ result = unify(type,alpha,typeProgIO,beta);
+ unrestrictBind();
+ emptySubstitution();
+ return result;
+}
/* --------------------------------------------------------------------------
* Matching predicates:
* included in the distribution.
*
* $RCSfile: type.c,v $
- * $Revision: 1.15 $
- * $Date: 1999/11/19 15:42:08 $
+ * $Revision: 1.16 $
+ * $Date: 1999/11/23 15:12:06 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
mark(predIntegral);
mark(starToStar);
mark(predMonad);
+ mark(typeProgIO);
break;
case INSTALL : typeChecker(RESET);
prelCleanupAfterRunAction = primRunST (newIORef Nothing)
-- used when Hugs invokes top level function
-primRunIO_hugs_toplevel :: IO () -> ()
+primRunIO_hugs_toplevel :: IO a -> ()
primRunIO_hugs_toplevel m
= protect 5 (fst (unST composite_action realWorld))
where
composite_action
= do writeIORef prelCleanupAfterRunAction Nothing
- m
+ m
cleanup_handles <- readIORef prelCleanupAfterRunAction
case cleanup_handles of
Nothing -> return ()