module Language.Lean.Module
( envImport
, envExport
, stdPath
, hottPath
) where
import Foreign
import Foreign.C
import Language.Lean.List
import Language.Lean.Internal.Decl
import Language.Lean.Internal.Exception
import Language.Lean.Internal.Exception.Unsafe
import Language.Lean.Internal.Name
import Language.Lean.Internal.IOS
import Language.Lean.Internal.String
envImport :: IOState tp -> Env -> List Name -> IO Env
envImport s e names = tryAllocLeanValue $ lean_env_import e (someIOS s) names
lean_env_import :: (Env) -> (SomeIOState) -> (ListName) -> (OutEnvPtr) -> (OutExceptionPtr) -> IO ((Bool))
lean_env_import a1 a2 a3 a4 a5 =
(withEnv) a1 $ \a1' ->
(withSomeIOState) a2 $ \a2' ->
(withListName) a3 $ \a3' ->
let {a4' = id a4} in
let {a5' = id a5} in
lean_env_import'_ a1' a2' a3' a4' a5' >>= \res ->
let {res' = toBool res} in
return (res')
envExport :: Env -> FilePath -> IO ()
envExport e path = runLeanPartialAction $ lean_env_export e path
lean_env_export :: (Env) -> (String) -> (OutExceptionPtr) -> IO ((Bool))
lean_env_export a1 a2 a3 =
(withEnv) a1 $ \a1' ->
withLeanStringPtr a2 $ \a2' ->
let {a3' = id a3} in
lean_env_export'_ a1' a2' a3' >>= \res ->
let {res' = toBool res} in
return (res')
stdPath :: String
stdPath = tryGetLeanValue $ lean_get_std_path
lean_get_std_path :: (Ptr CString) -> (OutExceptionPtr) -> IO ((Bool))
lean_get_std_path a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
lean_get_std_path'_ a1' a2' >>= \res ->
let {res' = toBool res} in
return (res')
hottPath :: String
hottPath = tryGetLeanValue $ lean_get_hott_path
lean_get_hott_path :: (Ptr CString) -> (OutExceptionPtr) -> IO ((Bool))
lean_get_hott_path a1 a2 =
let {a1' = id a1} in
let {a2' = id a2} in
lean_get_hott_path'_ a1' a2' >>= \res ->
let {res' = toBool res} in
return (res')
foreign import ccall safe "Language/Lean/Module.chs.h lean_env_import"
lean_env_import'_ :: ((EnvPtr) -> ((Ptr (SomeIOState)) -> ((ListNamePtr) -> ((OutEnvPtr) -> ((OutExceptionPtr) -> (IO CInt))))))
foreign import ccall safe "Language/Lean/Module.chs.h lean_env_export"
lean_env_export'_ :: ((EnvPtr) -> ((Ptr CChar) -> ((OutExceptionPtr) -> (IO CInt))))
foreign import ccall unsafe "Language/Lean/Module.chs.h lean_get_std_path"
lean_get_std_path'_ :: ((Ptr (Ptr CChar)) -> ((OutExceptionPtr) -> (IO CInt)))
foreign import ccall unsafe "Language/Lean/Module.chs.h lean_get_hott_path"
lean_get_hott_path'_ :: ((Ptr (Ptr CChar)) -> ((OutExceptionPtr) -> (IO CInt)))