git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
more fixes
0fc343dfaineance
src/Language/PureScript/TypeChecker/Monad.hs+1−2
@@ -224,8 +224,7 @@ runCheck = runCheck' initEnvironment
224
224
225-- | Run a computation in the typechecking monad, failing with an error, or succeeding with a return value and the final @Environment@.
225-- | Run a computation in the typechecking monad, failing with an error, or succeeding with a return value and the final @Environment@.
226runCheck' :: (Functor m) => Environment -> StateT CheckState m a -> m (a, Environment)
226runCheck' :: (Functor m) => Environment -> StateT CheckState m a -> m (a, Environment)
227−runCheck' env check = fmap (second checkEnv) $ runStateT check (emptyCheckState env)
227+runCheck' env check = second checkEnv <$> runStateT check (emptyCheckState env)
228−
229-- | Make an assertion, failing with an error message
228-- | Make an assertion, failing with an error message
230guardWith :: (MonadError e m) => e -> Bool -> m ()
229guardWith :: (MonadError e m) => e -> Bool -> m ()
231guardWith _ True = return ()
230guardWith _ True = return ()
tests/TestDocs.hs+4−4
@@ -35,10 +35,10 @@ main = do
35 forM_ testCases $ \(P.moduleNameFromString -> mn, pragmas) ->
35 forM_ testCases $ \(P.moduleNameFromString -> mn, pragmas) ->
36 let mdl = takeJust ("module not found in docs: " ++ P.runModuleName mn)
36 let mdl = takeJust ("module not found in docs: " ++ P.runModuleName mn)
37 (find ((==) mn . Docs.modName) pkgModules)
37 (find ((==) mn . Docs.modName) pkgModules)
38− in forM_ pragmas (flip runAssertionIO mdl)
38+ in forM_ pragmas (`runAssertionIO` mdl)
39
39
40takeJust :: String -> Maybe a -> a
40takeJust :: String -> Maybe a -> a
41−takeJust msg = maybe (error msg) id
41+takeJust msg = fromMaybe (error msg)
42
42
43data Assertion
43data Assertion
44 -- | Assert that a particular declaration is documented with the given
44 -- | Assert that a particular declaration is documented with the given
@@ -254,8 +254,8 @@ testCases =
254
254
255 , ("ExplicitTypeSignatures",
255 , ("ExplicitTypeSignatures",
256 [ ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "explicit" (ShowFn (hasTypeVar "something"))
256 [ ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "explicit" (ShowFn (hasTypeVar "something"))
257− , ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "anInt" (ShowFn ((==) P.tyInt))
257+ , ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "anInt" (ShowFn (P.tyInt ==))
258− , ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "aNumber" (ShowFn ((==) P.tyNumber))
258+ , ValueShouldHaveTypeSignature (n "ExplicitTypeSignatures") "aNumber" (ShowFn (P.tyNumber ==))
259 ])
259 ])
260 ]
260 ]
261
261
tests/TestPscPublish.hs+1−1
@@ -62,5 +62,5 @@ testPackage dir = do
62 pure ()
62 pure ()
63 other -> do
63 other -> do
64 putStrLn ("psc-publish tests failed on " ++ dir ++ ":")
64 putStrLn ("psc-publish tests failed on " ++ dir ++ ":")
65− putStrLn (show other)
65+ print other
66 exitFailure
66 exitFailure