# How to define an ADT?
PREREQUISITE
Open the respective .kdata file.
For example to define payment mode as an ADT, open LotteryData.kdata file in eclipse.
Define the adt using keyword
adtas follows:adt PaymentType(amount:Int) => Cheque(amount:Int,dateIssued:CalendarDate) | Cash(amount:Int)Note: Dont forget to save the file
enter sbt shell, run
compilecommand to access the enum.
# Sample Usage:
val payment = Cheque(amount = 10000, dateIssued = grab[TimeService].todayAtLocal)