mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2025-12-05 22:48:42 +00:00
59 lines
941 B
Text
59 lines
941 B
Text
struct Fruit =
|
|
| Apple
|
|
| Orange
|
|
| Banana
|
|
|
|
struct Optional 'A =
|
|
| Some & 'A
|
|
| None
|
|
|
|
struct (Result : #Move) 'A 'B =
|
|
| & 'A
|
|
| Error & 'B
|
|
|
|
struct (Complex : #Value) =
|
|
& Float
|
|
& Float
|
|
|
|
struct Task =
|
|
& name : String
|
|
& duration : Float
|
|
|
|
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)
|
|
|
|
|
|
class Bag =
|
|
&
|
|
( | Apple
|
|
| Orange
|
|
| Banana)
|
|
& bag_type :
|
|
( | Small
|
|
| Medium
|
|
& weight_kg : Int
|
|
& weight_g : Int
|
|
& weight_g : Int
|
|
| Big)
|
|
& other_things : (Array Something)
|