anchor.diff:          true ) event.fromRelations
   
       let workflow, name = eventName
  -    let inner (x : Map<string, bool*Event>) = 
  +    let inner (x : Map<string, bool*Event>) : UpdateMapResult = 
           match Map.tryFind name x with
               | Some(_) ->
  -                Map.remove name x
  -            | None -> failwith "Missing Event"
  +                MapOk(Map.remove name x)
  +            | None -> MapErr(MissingEvent)
   
  -    Ok(update_inner_map workflow inner repository)
  +    update_inner_map workflow inner repository
   
   /// Removes given roles form given event and returns the result
   let remove_event_roles (eventName : EventName) (roles : Roles) (repository : Repository) : Result =
  -    let inner (event : Event) : Event =
  -        {event with roles = Set.fold (fun x y -> x.Remove y) event.roles roles}
  -    Ok(update_inner_event eventName inner repository)
  +    let inner (event : Event) : UpdateEventResult =
  +        EventOk({event with roles = Set.fold (fun x y -> x.Remove y) event.roles roles})
  +    update_inner_event eventName inner repository
   
  
positive.code: 
  open Repository_types
  
  
  let update_inner_map (workflow : WorkflowName) (func : Map<string, bool*Event> -> Map<string, bool*Event>) (repository : Repository) : Repository =
      match Map.tryFind workflow repository.events with
      | Some(x)   ->
          let newInnerMap = func x
          {repository with events = Map.add workflow newInnerMap repository.events}
      | None      -> failwith "Missing Workflow"
  
  let update_inner_event (eventName : EventName) (func : Event -> Event) (repository : Repository) : Repository =
      let workflow, name = eventName
      let inner (eventMap : Map<string, bool*Event>) = 
          match Map.tryFind name eventMap with
              | Some(x')  ->
                  let lock, event = x'
                  Map.add name (lock, func event) eventMap
              | None      -> failwith "Missing Event"
  
      update_inner_map workflow inner repository
  
  
negative.code: 
      let workflow, name = eventName
      let event = get_event eventName repository
      let inner (x : Map<string, bool*Event>) : UpdateMapResult = 
          match Map.tryFind name x with
              | Some(x') ->
                  let lock, event = x'
                  MapOk(Map.add name (lock, {event with executed = true; pending = false}) x)
              | None -> MapErr(MissingEvent)
      
      if not event.included
      then NotExecutable
  