Switch opcode data type from normal to record constructors
Currently, the OpCode definitions are using normal constructors: data OpCode = OpTestDelay Double Bool [String] | OpInstanceFailover String Bool (Maybe String) … While this works for a few opcodes, it becomes unwieldy when dealing with a bigger number of opcode definitions and/or with opcodes having many fields. This patch changes the opcodes to record-based constructors, so that we get for free accessor functions: data OpCode = OpTestDelay { opDuration :: Double, opOnMaster :: Bool, opOnNodes :: [String] } | OpInstanceFailover { opInstanceName :: String, opIgnoreConsistency :: Bool, opTargetNode :: Maybe String } … Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Adeodato Simo <dato@google.com>
Loading
Please register or sign in to comment