From 131b4e3b018ad0537d38c0aa83dd3e823ebe8e95 Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Wed, 20 Feb 2019 19:28:38 +0200 Subject: [PATCH] Generalization of mapped property accessors for other data types gitlab #27 Change-Id: Id193ae3b4840a74710c6b86e32bfefd7e3fc3a17 --- org.simantics.district.network/scl/Simantics/District.scl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.45.2