fieldsToIndexMap :: [S.Field] -> M.Map Integer S.Field
fieldsToIndexMap fs = M.fromList $ map go fs
  where
    go f = (S.fieldIndex f, f)
fieldsToIndexMap :: [S.Field] -> M.Map Integer S.Field
fieldsToIndexMap fs = M.fromList $ map go fs
  where
    go f = (S.fieldIndex f, f)
fieldsToIndexMap fs = M.fromList $ map go fs
  where
    go f = (S.fieldIndex f, f)