]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Generalization of mapped property accessors for other data types 61/2661/2
authorReino Ruusu <reino.ruusu@semantum.fi>
Wed, 20 Feb 2019 17:28:38 +0000 (19:28 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Wed, 20 Feb 2019 17:32:43 +0000 (17:32 +0000)
gitlab #27

Change-Id: Id193ae3b4840a74710c6b86e32bfefd7e3fc3a17

org.simantics.district.network/scl/Simantics/District.scl

index 36dee3979b74ea97dbc7fc2e15fa507518332a11..2f46d361ded6b3eb212bec13d941e1dd6288b11a 100644 (file)
@@ -112,14 +112,14 @@ possibleMappedComponentVariable r = match possibleMappedComponent r with
 
 """
 """
-possibleMappedComponentPropertyValue :: String -> Resource -> <ReadGraph> Maybe Double
+possibleMappedComponentPropertyValue :: Serializable a => Typeable a => String -> Resource -> <ReadGraph> Maybe a
 possibleMappedComponentPropertyValue propName r = match possibleMappedComponentVariable r with
     Nothing -> Nothing
     Just mv -> possiblePropertyValue mv propName
 
 """
 """
-mappedComponentPropertyValue :: Double -> String -> Resource -> <ReadGraph> Double
+mappedComponentPropertyValue :: Serializable a => Typeable a => a -> String -> Resource -> <ReadGraph> a
 mappedComponentPropertyValue def propName r = match possibleMappedComponentVariable r with
     Nothing -> def
     Just mv -> match possiblePropertyValue mv propName with