+gEditor{|BCValue|} = {Editor|genUI=genUI`,onEdit=onEdit`,onRefresh=onRefresh`}
+ where
+ genUI` dp (BCValue a) vst = (castEditor a).Editor.genUI dp a vst
+ onEdit` dp jsn (BCValue a) em vst = appSnd3 BCValue $ (castEditor a).Editor.onEdit dp jsn a em vst
+ onRefresh` dp (BCValue a) (BCValue a`) em vst = appSnd3 BCValue $ (castEditor a).Editor.onRefresh dp a (fromByteCode $ toByteCode a`) em vst
+
+ castEditor :: a -> (Editor a) | mTaskType a
+ castEditor _ = gEditor{|*|}
+
+gText{|BCValue|} fm Nothing = []
+gText{|BCValue|} fm (Just (BCValue e)) = gText{|*|} fm (Just e)
+JSONEncode{|BCValue|} b (BCValue e) = JSONEncode{|*|} b (toByteCode e)
+JSONDecode{|BCValue|} b n = appFst (fmap fromByteCode) $ JSS b n
+ where
+ JSS :: (Bool [JSONNode] -> (Maybe String, [JSONNode]))
+ JSS = JSONDecode{|*|}
+gDefault{|BCValue|} = BCValue 0
+gEq{|BCValue|} (BCValue e) (BCValue f) = toByteCode e == toByteCode f
+
+derive class gCons Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin
+derive class iTask UserLED, Long, Pin, Button, AnalogPin, DigitalPin, PinMode, MTaskDeviceSpec