{-# LANGUAGE FlexibleContexts #-}
module Jikka.Core.Language.Lint where
import Jikka.Common.Error
import Jikka.Core.Language.Expr
import Jikka.Core.Language.TypeCheck
precondition :: MonadError Error m => m a -> m a
precondition :: m a -> m a
precondition = String -> m a -> m a
forall (m :: * -> *) a. MonadError Error m => String -> m a -> m a
wrapError' String
"precondition"
postcondition :: MonadError Error m => m a -> m a
postcondition :: m a -> m a
postcondition = String -> m a -> m a
forall (m :: * -> *) a. MonadError Error m => String -> m a -> m a
wrapError' String
"postcondition"
ensureEagerlyEvaluatable :: MonadError Error m => Program -> m ()
ensureEagerlyEvaluatable :: Program -> m ()
ensureEagerlyEvaluatable Program
_ = String -> m () -> m ()
forall (m :: * -> *) a. MonadError Error m => String -> m a -> m a
wrapError' String
"Jikka.Core.Language.Lint.ensureEagerlyEvaluatable" (m () -> m ()) -> m () -> m ()
forall a b. (a -> b) -> a -> b
$ do
() -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
ensureWellTyped :: MonadError Error m => Program -> m ()
ensureWellTyped :: Program -> m ()
ensureWellTyped Program
prog = String -> m () -> m ()
forall (m :: * -> *) a. MonadError Error m => String -> m a -> m a
wrapError' String
"Jikka.Core.Language.Lint.ensureWellTyped" (m () -> m ()) -> m () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Type
_ <- Program -> m Type
forall (m :: * -> *). MonadError Error m => Program -> m Type
typecheckProgram Program
prog
() -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()