« Previous | Next » 

Revision 8ee2994a

ID8ee2994a87f1bfc41e5d2f62723c39b67b0a37e1
Parent 51d991d7
Child 1a865afe

Added by Iustin Pop over 11 years ago

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 <>
Reviewed-by: Adeodato Simo <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences