From: Reino Ruusu Date: Wed, 20 Feb 2019 17:28:38 +0000 (+0200) Subject: Generalization of mapped property accessors for other data types X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=131b4e3b018ad0537d38c0aa83dd3e823ebe8e95;p=simantics%2Fdistrict.git Generalization of mapped property accessors for other data types gitlab #27 Change-Id: Id193ae3b4840a74710c6b86e32bfefd7e3fc3a17 --- diff --git a/org.simantics.district.network/scl/Simantics/District.scl b/org.simantics.district.network/scl/Simantics/District.scl index 36dee397..2f46d361 100644 --- a/org.simantics.district.network/scl/Simantics/District.scl +++ b/org.simantics.district.network/scl/Simantics/District.scl @@ -112,14 +112,14 @@ possibleMappedComponentVariable r = match possibleMappedComponent r with """ """ -possibleMappedComponentPropertyValue :: String -> Resource -> Maybe Double +possibleMappedComponentPropertyValue :: Serializable a => Typeable a => String -> Resource -> Maybe a possibleMappedComponentPropertyValue propName r = match possibleMappedComponentVariable r with Nothing -> Nothing Just mv -> possiblePropertyValue mv propName """ """ -mappedComponentPropertyValue :: Double -> String -> Resource -> Double +mappedComponentPropertyValue :: Serializable a => Typeable a => a -> String -> Resource -> a mappedComponentPropertyValue def propName r = match possibleMappedComponentVariable r with Nothing -> def Just mv -> match possiblePropertyValue mv propName with