---
# System prepended metadata

title: Untitled

---

You are invited as a consultant to write software which will control an
elevator. The setup includes a single elevator and several floors with a
call button per floor. In the elevator there are also buttons that allow
people inside to select the destination floor(s). A solution to this task
could be e.g. a function that handles various events happening to the
elevator. Feel free to introduce any data type definitions and helper
functions.

```haskell

data ElevatorEvents = Call Int 
               | InCarriageButtonPress Int 
               | Arrived Int  
               | OpenedDoors 
               | ClosedDoors 
             
              
             
data Next =  

elevatorControlSystem :: [ElevatorEvent] -> Next


```