threadAtAccess :: History -> AccessNr -> Either String ThreadId
threadAtAccess hist acc =
    historyFold (\rest (HistoryRun tid acc') ->
                     if (Finite acc) < acc'
                     then Right tid
                     else rest) (Left "ran out of history") hist
threadAtAccess :: History -> AccessNr -> Either String ThreadId
threadAtAccess hist acc =
    historyFold (\rest (HistoryRun tid acc') ->
                     if (Finite acc) < acc'
                     then Right tid
                     else rest) (Left "ran out of history") hist
threadAtAccess hist acc =
    historyFold (\rest (HistoryRun tid acc') ->
                     if (Finite acc) < acc'
                     then Right tid
                     else rest) (Left "ran out of history") hist