@@ -300,23 +300,20 @@ handleTypeOf value = do
301-- Takes a value and prints its kind
301-- Takes a value and prints its kind
303−handleKindOf :: P.Value -> PSCI ()
303+handleKindOf :: P.Type -> PSCI ()
304−handleKindOf value = do
304+handleKindOf typ = do
305 st <- PSCI $ lift get
305 st <- PSCI $ lift get
306− let m = createTemporaryModule False st value
306+ let m = createTemporaryModule False st (P.BooleanLiteral True) -- dummy value
307 mName = P.ModuleName [P.ProperName "Main"]
307 mName = P.ModuleName [P.ProperName "Main"]
308 e <- psciIO . runMake $ P.make modulesDir options (psciLoadedModules st ++ [("Main.purs", m)])
308 e <- psciIO . runMake $ P.make modulesDir options (psciLoadedModules st ++ [("Main.purs", m)])
309 case e of
309 case e of
310 Left err -> PSCI $ outputStrLn err
310 Left err -> PSCI $ outputStrLn err
311− Right env' ->
311+ Right env' -> do
312− case M.lookup (mName, P.Ident "it") (P.names env') of
313− Just (ty, _, _) -> do
314− let st = P.CheckState env' 0 0 (Just mName)
312+ let st = P.CheckState env' 0 0 (Just mName)
315− k = L.runStateT (P.unCheck (P.kindOf mName ty)) st
313+ k = L.runStateT (P.unCheck (P.kindOf mName typ)) st
316− case k of
314+ case k of
317− Left errStack -> PSCI . outputStrLn . P.prettyPrintErrorStack False $ errStack
315+ Left errStack -> PSCI . outputStrLn . P.prettyPrintErrorStack False $ errStack
318− Right (kind, _) -> PSCI . outputStrLn . P.prettyPrintKind $ kind
316+ Right (kind, _) -> PSCI . outputStrLn . P.prettyPrintKind $ kind
319− Nothing -> PSCI $ outputStrLn "Could not find kind"
321-- Commands
318-- Commands
@@ -361,7 +358,7 @@ handleCommand Reset = do
361 Left err -> psciIO $ putStrLn err >> exitFailure
358 Left err -> psciIO $ putStrLn err >> exitFailure
362 Right modules -> PSCI . lift $ put (PSCiState files defaultImports modules [])
359 Right modules -> PSCI . lift $ put (PSCiState files defaultImports modules [])
363handleCommand (TypeOf val) = handleTypeOf val
360handleCommand (TypeOf val) = handleTypeOf val
364−handleCommand (KindOf val) = handleKindOf val
361+handleCommand (KindOf typ) = handleKindOf typ
365handleCommand _ = PSCI $ outputStrLn "Unknown command"
362handleCommand _ = PSCI $ outputStrLn "Unknown command"
367inputFiles :: Cmd.Term [FilePath]
364inputFiles :: Cmd.Term [FilePath]