2023-03-31 12:10:12 +03:00
|
|
|
namespace Employee {
|
|
|
|
|
decl gen_employee : Unit -> Employee
|
2023-05-07 19:52:35 +03:00
|
|
|
def gen_employee : a = {
|
2023-03-31 12:10:12 +03:00
|
|
|
return
|
|
|
|
|
$Employee
|
|
|
|
|
& name = "John"
|
|
|
|
|
& role =
|
|
|
|
|
($Manager
|
2023-04-25 21:21:36 +03:00
|
|
|
& "John"
|
2023-03-31 12:10:12 +03:00
|
|
|
& productivity =
|
2023-04-25 21:21:36 +03:00
|
|
|
($Productivity::High
|
2023-03-31 12:10:12 +03:00
|
|
|
& duration = 10.3
|
2023-04-25 21:21:36 +03:00
|
|
|
& sleep_on_work = ($Productivity::SleepOnWork::No))
|
2023-03-31 12:10:12 +03:00
|
|
|
& salary = 123)
|
2023-04-11 13:49:22 +03:00
|
|
|
|
2023-03-31 12:10:12 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
class Employee =
|
|
|
|
|
& name : String
|
|
|
|
|
& role :
|
|
|
|
|
( | Director
|
|
|
|
|
& importance : Float
|
|
|
|
|
& share : Float
|
|
|
|
|
| Manager
|
|
|
|
|
& productivity :
|
|
|
|
|
( Productivity
|
|
|
|
|
| .Low
|
|
|
|
|
| .Average
|
|
|
|
|
| .High
|
|
|
|
|
& duration : Float
|
|
|
|
|
& sleep_on_work :
|
|
|
|
|
(SleepOnWork
|
|
|
|
|
| ..Yes
|
|
|
|
|
| ..No
|
|
|
|
|
))
|
|
|
|
|
& salary : Int
|
|
|
|
|
| Programmer
|
|
|
|
|
& skills : Float
|
|
|
|
|
& current_task : Optional Task
|
|
|
|
|
& salary : Int)
|
|
|
|
|
*/
|