fakeLibPQMaxColumn :: FakeLibPQResult -> Maybe Column
fakeLibPQMaxColumn result =
  let maxColumnsByRow =
        map fst
          . Maybe.mapMaybe Map.lookupMax
          . Map.elems
          . fakeLibPQRows
          $ result
   in case maxColumnsByRow of
        [] ->
          Nothing
        _ ->
          Just (maximum maxColumnsByRow)
fakeLibPQMaxColumn :: FakeLibPQResult -> Maybe Column
fakeLibPQMaxColumn result =
  let maxColumnsByRow =
        map fst
          . Maybe.mapMaybe Map.lookupMax
          . Map.elems
          . fakeLibPQRows
          $ result
   in case maxColumnsByRow of
        [] ->
          Nothing
        _ ->
          Just (maximum maxColumnsByRow)
fakeLibPQMaxColumn result =
  let maxColumnsByRow =
        map fst
          . Maybe.mapMaybe Map.lookupMax
          . Map.elems
          . fakeLibPQRows
          $ result
   in case maxColumnsByRow of
        [] ->
          Nothing
        _ ->
          Just (maximum maxColumnsByRow)