X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fscl%2FSimantics%2FModel.scl;fp=bundles%2Forg.simantics.modeling%2Fscl%2FSimantics%2FModel.scl;h=c631d399e99e18a4a17825538b312bd41f634ab4;hb=a42562ce5347643cf8303eb4c6acef4d65c9e210;hp=a2531e3e07a7060e02d9e5cab2a505611e771b8d;hpb=d615f9ce52ccde4f0de408d6345d033faa4590e6;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/scl/Simantics/Model.scl b/bundles/org.simantics.modeling/scl/Simantics/Model.scl index a2531e3e0..c631d399e 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Model.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Model.scl @@ -11,7 +11,7 @@ Returns an existing model in the current project with the given `name` """ model :: String -> Model model name = match possibleResourceChild (currentProject ()) name with - Just m -> fromResource m + Just m -> m Nothing -> fail $ "Didn't find a model " + name + "." """ @@ -21,15 +21,13 @@ Returns the configuration of the given `model` and returns the `configuration` resource """ configurationOf :: Model -> Configuration -configurationOf m = do - conf = singleObject (toResource m) SIMU.HasConfiguration - fromResource conf +configurationOf m = singleObject m SIMU.HasConfiguration """ Returns the list of all models in the current project. """ allModels :: () -> [Model] -allModels _ = map fromResource $ objectsWithType (currentProject ()) L0.ConsistsOf SIMU.Model +allModels _ = objectsWithType (currentProject ()) L0.ConsistsOf SIMU.Model importJava "org.simantics.modeling.ModelingUtils" where """Removes the index associated with the model."""