module { export = [possibleUnsafeSclValueByName, unsafeSclValueByName, sclModuleNames] } include "SCL/ReflectionJava" importJava "org.simantics.scl.compiler.module.repository.ModuleRepository" where @JavaName getValue unsafeSclValueByName_ :: ModuleRepository -> String -> a @JavaName getSourceRepository moduleSourceRepositoryOf :: ModuleRepository -> ModuleSourceRepository importJava "org.simantics.scl.compiler.source.repository.ModuleSourceRepository" where data ModuleSourceRepository @JavaName getModuleNames sclModuleNames_ :: ModuleSourceRepository -> [String] unsafeSclValueByName :: String -> a unsafeSclValueByName = unsafeSclValueByName_ MODULE_REPOSITORY possibleUnsafeSclValueByName :: String -> Maybe a possibleUnsafeSclValueByName name = Just (unsafeSclValueByName name) `catch` \(_ :: Exception) -> Nothing sclModuleNames :: [String] sclModuleNames = sclModuleNames_ (moduleSourceRepositoryOf MODULE_REPOSITORY)