From a42562ce5347643cf8303eb4c6acef4d65c9e210 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Tue, 24 Jan 2017 15:55:26 +0200 Subject: [PATCH] Removed uses of deprecated functions Change-Id: I64fa1d6ce189f24edf33657db81780c3fb83f2ee --- .../scl/Simantics/Annotation2.scl | 4 +- .../scl/Simantics/Chart.scl | 6 +-- .../scl/Simantics/Document.scl | 8 ++-- .../scl/Simantics/DrawingTemplate.scl | 4 +- .../scl/Simantics/Library.scl | 6 +-- .../scl/Simantics/Diagram.scl | 46 +++++++++---------- .../scl/Simantics/DiagramMapping.scl | 6 +-- .../scl/Simantics/Flag.scl | 14 +++--- .../scl/Simantics/Issue.scl | 6 +-- .../scl/Simantics/Model.scl | 8 ++-- .../scl/Simantics/Rename.scl | 4 +- .../scl/Simantics/Scenegraph.scl | 24 +++++----- .../scl/Simantics/Subscription.scl | 7 +-- .../scl/Simantics/UserComponent.scl | 21 ++++----- .../scl/Simantics/Variables.scl | 4 +- .../org.simantics.scl.runtime/scl/Prelude.scl | 2 +- 16 files changed, 80 insertions(+), 90 deletions(-) diff --git a/bundles/org.simantics.annotation.ui/scl/Simantics/Annotation2.scl b/bundles/org.simantics.annotation.ui/scl/Simantics/Annotation2.scl index cd3f851cb..b06a8bdd4 100644 --- a/bundles/org.simantics.annotation.ui/scl/Simantics/Annotation2.scl +++ b/bundles/org.simantics.annotation.ui/scl/Simantics/Annotation2.scl @@ -104,13 +104,13 @@ getPossibleAnnotationType model name = do all = searchByType model ANNO.AnnotationType named = filter (\x -> (getAnnotationNameFromType x) == name) all if ((length named) == 1) - then Just (fromResource $ named!0) + then Just (named!0) else Nothing setAnnotationPropertyValue :: AnnotationPropertyRelation -> Resource -> String -> String -> () setAnnotationPropertyValue annotation resource property newValue = do resourceUri = uriOf resource - annotationName = DB.nameOf (toResource annotation) + annotationName = DB.nameOf annotation completeUri = resourceUri + "#" + annotationName + "#" + property + "#HasDisplayValue" propertyVariable = variable completeUri setValue propertyVariable newValue diff --git a/bundles/org.simantics.charts/scl/Simantics/Chart.scl b/bundles/org.simantics.charts/scl/Simantics/Chart.scl index 3972fd95c..71d20dcce 100644 --- a/bundles/org.simantics.charts/scl/Simantics/Chart.scl +++ b/bundles/org.simantics.charts/scl/Simantics/Chart.scl @@ -45,11 +45,11 @@ importJava "org.simantics.charts.ui.SCLChart" where Browses the given Model for its Charts and then returns them in a list. """ chartsOf :: Model -> [Chart] -chartsOf model = recurse (toResource model) +chartsOf model = recurse model where recurse r = do - cs = resourceChildrenOf r - charts = map fromResource $ filter isChart cs + cs = children r + charts = filter isChart cs chartGrp = filter isChartGroup cs charts + concatMap recurse chartGrp isChart r = isInstanceOf r CHART.TimeSeriesChart diff --git a/bundles/org.simantics.document.ui/scl/Simantics/Document.scl b/bundles/org.simantics.document.ui/scl/Simantics/Document.scl index 2493b1c2c..6cd9ccebb 100644 --- a/bundles/org.simantics.document.ui/scl/Simantics/Document.scl +++ b/bundles/org.simantics.document.ui/scl/Simantics/Document.scl @@ -15,20 +15,20 @@ importJava "org.simantics.document.ui.actions.ExportDocumentFile" where exportDocument :: Resource -> String -> () documentsFolders :: Model -> [Resource] -documentsFolders model = recurse DOCUMENT.DocumentLibrary (toResource model) +documentsFolders model = recurse DOCUMENT.DocumentLibrary model where recurse t r = do - cs = resourceChildrenOf r + cs = children r libraries = filter isLibrary cs libraryGrp = filter (not . isLibrary) cs libraries + concatMap (recurse t) libraryGrp isLibrary r = isInstanceOf r DOCUMENT.DocumentLibrary documents :: Model -> [Resource] -documents model = recurse DOCUMENT.Document (toResource model) +documents model = recurse DOCUMENT.Document model where recurse t r = do - cs = resourceChildrenOf r + cs = children r documents = filter isDocument cs documentFolder = filter (not . isDocument) cs documents + concatMap (recurse t) documentFolder diff --git a/bundles/org.simantics.modeling.template2d.ui/scl/Simantics/DrawingTemplate.scl b/bundles/org.simantics.modeling.template2d.ui/scl/Simantics/DrawingTemplate.scl index 34b4f82f2..7550f7073 100644 --- a/bundles/org.simantics.modeling.template2d.ui/scl/Simantics/DrawingTemplate.scl +++ b/bundles/org.simantics.modeling.template2d.ui/scl/Simantics/DrawingTemplate.scl @@ -114,14 +114,14 @@ importJava "org.simantics.modeling.ModelingUtils" where setMonitorPropertyValue :: Monitor -> String -> String -> () setMonitorPropertyValue monitor property newValue = do - monitorUri = uriOf (toResource monitor) + monitorUri = uriOf monitor completeUri = monitorUri + "#" + property + "#HasDisplayValue" propertyVariable = variable completeUri setValue propertyVariable newValue setFlagTablePropertyValue :: FlagTable -> String -> String -> () setFlagTablePropertyValue flagTable property newValue = do - flagTableUri = uriOf (toResource flagTable) + flagTableUri = uriOf flagTable completeUri = flagTableUri + "#" + property + "#HasDisplayValue" propertyVariable = variable completeUri setValue propertyVariable newValue diff --git a/bundles/org.simantics.modeling.ui/scl/Simantics/Library.scl b/bundles/org.simantics.modeling.ui/scl/Simantics/Library.scl index 827756855..ee4d7885e 100644 --- a/bundles/org.simantics.modeling.ui/scl/Simantics/Library.scl +++ b/bundles/org.simantics.modeling.ui/scl/Simantics/Library.scl @@ -21,11 +21,11 @@ importJava "org.simantics.modeling.ui.SCLLibrary" where getLibrary :: Model -> String -> Library librariesOf :: Model -> [Library] -librariesOf model = recurse L0.Library (toResource model) +librariesOf model = recurse L0.Library model where recurse t r = do - cs = resourceChildrenOf r - libraries = map fromResource $ filter isLibrary cs + cs = children r + libraries = filter isLibrary cs libraryGrp = filter (not . isLibrary) cs libraries + concatMap (recurse t) libraryGrp isLibrary r = isInstanceOf r L0.Library \ No newline at end of file diff --git a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl index 2490acc5b..6e04a6f6d 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Diagram.scl @@ -140,18 +140,18 @@ hasRandomIdentifier entity = runProc (claimRelatedValue_ entity L0.identifier GU diagramsOf :: Model -> [Diagram] diagramsOf model = recurse DIA.Diagram - (toResource (configurationOf model)) + (configurationOf model) where recurse t r = do - cs = resourceChildrenOf r - dias = map fromResource $ filter isDiagramComposite cs + cs = children r + dias = filter isDiagramComposite cs folders = filter (not . isDiagramComposite) cs dias + concatMap (recurse t) folders isDiagramComposite r = existsStatement r MOD.CompositeToDiagram """Returns a model relative path of the given diagram.""" pathOf :: Diagram -> [String] -pathOf diagram = map nameOf $ unfoldl aux $ toResource diagram +pathOf diagram = map nameOf $ unfoldl aux diagram where aux r = if existsStatement r SIMU.IsConfigurationOf then Nothing @@ -169,7 +169,7 @@ pathNameOf diagram = do // @Private? diagramResourceOf :: Diagram -> Resource -diagramResourceOf d = singleObject (toResource d) MOD.CompositeToDiagram +diagramResourceOf d = singleObject d MOD.CompositeToDiagram import "Extras/HashMap" as Map @@ -214,11 +214,11 @@ compositeToDiagram' c = singleObject c MOD.CompositeToDiagram """Creates or modifies an existing diagram to contain the given diagram elements.""" createDiagramR :: DiagramSpec -> (Dynamic -> Resource) -> [DiagramElement Resource] -> (Diagram, [Resource]) createDiagramR (ExistingDiagram diagram') joinMap elementSpecs = runProc do - configuration = toResource diagram' + configuration = diagram' diagram = compositeToDiagram' configuration hasName = L0.HasName componentMap = Map.fromList [ (c `relatedValue` hasName :: String, c) - | c <- resourceChildrenOf configuration + | c <- children configuration ] denyByPredicate diagram L0.ConsistsOf elements = setElements (DiagramInfo diagram configuration componentMap) joinMap elementSpecs @@ -232,12 +232,12 @@ createDiagramR (NewDiagram model path folderType compositeType) joinMap elementS elements = setElements (DiagramInfo diagram configuration (Map.create ())) joinMap elementSpecs claimRelatedValue diagram DIA.HasModCount (fromInteger (length elements) :: Long) - (fromResource configuration, elements) + (configuration, elements) ) where createConfiguration () = do lastId = length path - 1 parentFolder = foldl (\p id -> getOrCreateFolder p (path!id)) - (toResource (configurationOf model)) + (configurationOf model) [0..lastId-1] createComposite_ parentFolder (path!lastId) compositeType getOrCreateFolder parentFolder name = @@ -250,14 +250,14 @@ claimFolder :: Model -> [String] -> Resource -> Resource claimFolder model path folderType = do lastId = length path foldl (\p id -> getOrCreateFolder p folderType (path!id)) - (toResource (configurationOf model)) + (configurationOf model) [0..lastId-1] claimModelFolder :: Model -> [String] -> Resource -> Resource claimModelFolder model path folderType = do lastId = length path foldl (\p id -> getOrCreateFolder p folderType (path!id)) - (toResource model) + model [0..lastId-1] getOrCreateFolder :: Resource -> Resource -> String -> Resource @@ -554,21 +554,21 @@ setElements (DiagramInfo diagram configuration componentMap) joinMap elementSpec """Returns a diagram in the given model with the given model relative path.""" diagram :: Model -> [String] -> Diagram diagram model path = - fromResource $ foldl + foldl (\r name -> match possibleResourceChild r name with Just c -> c Nothing -> fail ("Didn't find " + name + ".") ) - (toResource (configurationOf model)) path + (configurationOf model) path possibleDiagram :: Model -> [String] -> (Maybe Diagram) possibleDiagram model path = - map fromResource (foldl + foldl (\r name -> match r with Just p -> possibleResourceChild p name Nothing -> Nothing ) - (Just $ toResource (configurationOf model)) path) + (Just (configurationOf model)) path /* """FIXME: doesn't work anymore with the elementsOfR spec @@ -757,7 +757,7 @@ importJava "org.simantics.modeling.typicals.TypicalUtil" where syncActivateDiagram :: Diagram -> Boolean syncActivateDiagram composite = do - diagram = compositeToDiagram' $ toResource composite + diagram = compositeToDiagram' composite syncActivateOnce diagram True @@ -768,25 +768,21 @@ importJava "org.simantics.structural2.utils.StructuralUtils" where createComposite__ :: Configuration -> String -> Resource -> Diagram compositeToDiagram :: Resource -> Diagram -compositeToDiagram c = fromResource (singleObject c MOD.CompositeToDiagram) +compositeToDiagram c = singleObject c MOD.CompositeToDiagram createComposite :: Configuration -> String -> Resource -> Diagram createComposite diagramFolder name compositeType = do - newName = findFreshName name (toResource diagramFolder) + newName = findFreshName name diagramFolder createComposite__ diagramFolder newName compositeType elementToComponent :: Element -> Component -elementToComponent element = do - component = singleObject (toResource element) MOD.ElementToComponent - fromResource component +elementToComponent element = singleObject element MOD.ElementToComponent componentToElement :: Component -> Element -componentToElement component = do - element = singleObject (toResource component) MOD.ComponentToElement - fromResource element +componentToElement component = singleObject component MOD.ComponentToElement getConnections :: Diagram -> [Resource] -getConnections diagram = [object | object <- (toResource $ compositeToDiagram $ toResource diagram) # L0.ConsistsOf, isInstanceOf object DIA.RouteGraphConnection] +getConnections diagram = [object | object <- (compositeToDiagram diagram) # L0.ConsistsOf, isInstanceOf object DIA.RouteGraphConnection] getConnection :: Diagram -> String -> [Resource] getConnection diagram name = do diff --git a/bundles/org.simantics.modeling/scl/Simantics/DiagramMapping.scl b/bundles/org.simantics.modeling/scl/Simantics/DiagramMapping.scl index c11fc532d..a612aca96 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/DiagramMapping.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/DiagramMapping.scl @@ -50,7 +50,7 @@ translateDiagrams (sourceModel :: Model) $ sourceDiagram for targetDiagrams $ \diagram -> - syncActivateOnce $ toResource diagram + syncActivateOnce diagram doElementPostProcessing elementMap elementPostProcessing @@ -74,7 +74,7 @@ translateDiagram (sourceModel :: Model) possibleDrawingTemplate :: Model -> Diagram -> Maybe Resource possibleDrawingTemplate model d = do d' = diagramResourceOf d - library = fromJust $ possibleResourceChild (toResource model) "Diagram Templates" + library = fromJust $ possibleResourceChild model "Diagram Templates" match (possibleObject d' TMPL.HasDrawingTemplate) with Just dt -> match (possibleNameOf dt) with Just name -> possibleResourceChild library name @@ -102,7 +102,7 @@ store elementMap a b c = do () getTargetComponent (targetDiagram :: Diagram) (sourceComponent :: Resource) = - (possibleResourceChild (toResource targetDiagram) (fromJust $ possibleNameOf sourceComponent)) :: Maybe Resource + (possibleResourceChild targetDiagram (fromJust $ possibleNameOf sourceComponent)) :: Maybe Resource translateDiagram2 (targetModel :: Model) (sourceDiagram :: Diagram) diff --git a/bundles/org.simantics.modeling/scl/Simantics/Flag.scl b/bundles/org.simantics.modeling/scl/Simantics/Flag.scl index 61eb7bd64..4cf529872 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Flag.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Flag.scl @@ -6,8 +6,9 @@ type Flag = Resource // FLAGS --------------------------- +@deprecated "Unnecessary function." toFlag :: Resource -> Flag -toFlag flag = (fromResource flag) +toFlag flag = flag importJava "org.simantics.modeling.flags.MergeFlags" where @JavaName mergeFlags @@ -34,21 +35,20 @@ joinFlags flag1 flag2 = do hasType STR.ConnectionJoin, hasStatement DIA.JoinsFlag - (toResource flag1), + flag1, hasStatement DIA.JoinsFlag - (toResource flag2) + flag2 ] () +@deprecated "Unnecessary function." flagToElement :: Flag -> Element -flagToElement flag = do - flagResource = toResource flag - fromResource flagResource +flagToElement flag = flag getFlags :: Diagram -> [Resource] getFlags dia = do - children = collectionToList (objects_ (singleObject (toResource dia) MOD.CompositeToDiagram) L0.ConsistsOf) + children = collectionToList (objects_ (singleObject dia MOD.CompositeToDiagram) L0.ConsistsOf) flags = filter (\x -> isInstanceOf x DIA.Flag) children flags diff --git a/bundles/org.simantics.modeling/scl/Simantics/Issue.scl b/bundles/org.simantics.modeling/scl/Simantics/Issue.scl index c7628bc93..e09297750 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Issue.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Issue.scl @@ -6,11 +6,11 @@ type Issue = Resource type Severity = Resource issuesOf :: Model -> [Issue] -issuesOf model = recurse ISSUE.Issue (toResource model) +issuesOf model = recurse ISSUE.Issue model where recurse t r = do - cs = resourceChildrenOf r - issues = map fromResource $ filter isIssue cs + cs = children r + issues = filter isIssue cs issueGrp = filter (not . isIssue) cs issues + concatMap (recurse t) issueGrp isIssue r = isInstanceOf r ISSUE.Issue 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.""" diff --git a/bundles/org.simantics.modeling/scl/Simantics/Rename.scl b/bundles/org.simantics.modeling/scl/Simantics/Rename.scl index 8199a000e..cb048e037 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Rename.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Rename.scl @@ -30,9 +30,9 @@ Example: or error if failed """ +@deprecated "This function is equivalent to renameNode." renameMBNode :: Resource -> String -> String -renameMBNode entity newname = do - renameNode (toResource entity) newname +renameMBNode entity newname = renameNode entity newname importJava "org.simantics.db.common.utils.NameUtils" where @JavaName findFreshName diff --git a/bundles/org.simantics.modeling/scl/Simantics/Scenegraph.scl b/bundles/org.simantics.modeling/scl/Simantics/Scenegraph.scl index dae67434e..fa1d2193f 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Scenegraph.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Scenegraph.scl @@ -54,10 +54,10 @@ importJava "org.simantics.modeling.SCLScenegraph" where getSceneGraphProvider :: Diagram -> ICanvasSceneGraphProvider getSceneGraphProvider diagram = do - diagramName = syncRead(\() -> getSafeName (toResource diagram)) + diagramName = syncRead(\() -> getSafeName diagram) diagramRVI = "/" + diagramName - model = syncRead(\() -> getPossibleModel (toResource diagram)) - composite = syncRead(\() -> compositeToDiagram' (toResource diagram)) + model = syncRead(\() -> getPossibleModel diagram) + composite = syncRead(\() -> compositeToDiagram' diagram) getICanvasSceneGraphProvider model composite diagramRVI getDiagramContext :: ICanvasSceneGraphProvider -> ICanvasContext @@ -66,30 +66,30 @@ getDiagramContext provider = do getNodeTransform :: Diagram -> String -> String getNodeTransform diagram nodeName = do - diagramName = syncRead(\() -> getSafeName (toResource diagram)) + diagramName = syncRead(\() -> getSafeName diagram) diagramRVI = "/" + diagramName - model = syncRead(\() -> getPossibleModel (toResource diagram)) - composite = syncRead(\() -> compositeToDiagram' (toResource diagram)) + model = syncRead(\() -> getPossibleModel diagram) + composite = syncRead(\() -> compositeToDiagram' diagram) provider = getICanvasSceneGraphProvider model composite diagramRVI context = getCanvasContext provider getTransform context nodeName getNodeText :: Diagram -> String -> String getNodeText diagram nodeName = do - diagramName = syncRead(\() -> getSafeName (toResource diagram)) + diagramName = syncRead(\() -> getSafeName diagram) diagramRVI = "/" + diagramName - model = syncRead(\() -> getPossibleModel (toResource diagram)) - composite = syncRead(\() -> compositeToDiagram' (toResource diagram)) + model = syncRead(\() -> getPossibleModel diagram) + composite = syncRead(\() -> compositeToDiagram' diagram) provider = getICanvasSceneGraphProvider model composite diagramRVI context = getCanvasContext provider getText context nodeName getNodeCount :: Diagram -> String getNodeCount diagram = do - diagramName = syncRead(\() -> getSafeName (toResource diagram)) + diagramName = syncRead(\() -> getSafeName diagram) diagramRVI = "/" + diagramName - model = syncRead(\() -> getPossibleModel (toResource diagram)) - composite = syncRead(\() -> compositeToDiagram' (toResource diagram)) + model = syncRead(\() -> getPossibleModel diagram) + composite = syncRead(\() -> compositeToDiagram' diagram) provider = getICanvasSceneGraphProvider model composite diagramRVI context = getCanvasContext provider getCount context diff --git a/bundles/org.simantics.modeling/scl/Simantics/Subscription.scl b/bundles/org.simantics.modeling/scl/Simantics/Subscription.scl index 111e88b01..01bc3f058 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/Subscription.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/Subscription.scl @@ -196,10 +196,7 @@ Example: Model contains two subscription folders called **Default** and **Pressu """ subscriptionFoldersOf :: Model -> [SubscriptionFolder] -subscriptionFoldersOf model = recurse (toResource model) +subscriptionFoldersOf model = recurse model where - recurse r = do - cs = resourceChildrenOf r - folders = map fromResource $ filter isSubscriptionFolder cs - folders + recurse r = filter isSubscriptionFolder (children r) isSubscriptionFolder r = isInstanceOf r MOD.Subscription diff --git a/bundles/org.simantics.modeling/scl/Simantics/UserComponent.scl b/bundles/org.simantics.modeling/scl/Simantics/UserComponent.scl index a4c834b4f..ecc84dcc6 100644 --- a/bundles/org.simantics.modeling/scl/Simantics/UserComponent.scl +++ b/bundles/org.simantics.modeling/scl/Simantics/UserComponent.scl @@ -13,7 +13,7 @@ importJava "org.simantics.modeling.NewComponentType" where configurationOfComponentType :: UserComponent -> Resource configurationOfComponentType component = do - config = singleObject (toResource component) STR.IsDefinedBy + config = singleObject component STR.IsDefinedBy config importJava "org.simantics.modeling.flags.LiftFlag" where @@ -21,19 +21,18 @@ importJava "org.simantics.modeling.flags.LiftFlag" where flagToTerminal :: Flag -> Resource flagToTerminal flag = do - result = liftFlag (toResource flag) + result = liftFlag flag if result == Nothing - then singleObject (toResource flag) DIA.IsLiftedAs - else do - show result - (toResource flag) - + then singleObject flag DIA.IsLiftedAs + else flag + +@deprecated "Calling this function is unnecessary." configToDiagram :: Resource -> Diagram -configToDiagram config = do - fromResource config +configToDiagram config = config populateTerminalToSymbol :: Resource -> (Double, Double) -> Element -populateTerminalToSymbol terminal (x, y) = do +populateTerminalToSymbol terminal (x, y) = element + where uc = singleObject terminal L0.PartOf symbol = singleObject uc MOD.ComponentTypeToSymbol diagram = singleObject symbol STR.IsDefinedBy @@ -59,7 +58,7 @@ populateTerminalToSymbol terminal (x, y) = do (toDoubleArray [1,0,0,1,x,y]) addToGraph diagram terminal element addCommentMetadata ("Populated terminal " + (show element) + " to user component " + (show uc)) - (fromResource element) + importJava "org.simantics.modeling.symbolEditor.PopulateTerminal" where addToGraph :: Resource -> Resource -> Resource -> () diff --git a/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl b/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl index d96dacdfd..721d52b15 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl @@ -332,13 +332,13 @@ Example: """ modelVariableOfVariable :: Variable -> Variable -modelVariableOfVariable var = variable $ uriOf $ toResource $ modelOfVariable var +modelVariableOfVariable var = variable $ uriOf $ modelOfVariable var uniqueChild :: Model -> Resource -> String -> Variable uniqueChild model typet childName = do typeName = DB.nameOf typet query = "Types: " + typeName + " AND Name: " + childName - moduleResources = searchByQuery (toResource model) query + moduleResources = searchByQuery model query variable $ uriOf $ moduleResources ! 0 """ diff --git a/bundles/org.simantics.scl.runtime/scl/Prelude.scl b/bundles/org.simantics.scl.runtime/scl/Prelude.scl index 2c5966dc4..c81f83089 100644 --- a/bundles/org.simantics.scl.runtime/scl/Prelude.scl +++ b/bundles/org.simantics.scl.runtime/scl/Prelude.scl @@ -1396,7 +1396,7 @@ instance Show String where instance Read String where read str = str -@deprecated +@deprecated "Instead of 'splitString text pattern', write 'split pattern text' (note change in the parameter order)." "`splitString text pattern` splits the string into a list of string where the parts are sepratated in the original list by the given pattern." splitString :: String -> String -> [String] splitString source pattern = arrayToList $ splitString_ source pattern -- 2.43.2