@@ -39,7 +39,7 @@ mkRowFromArgs names df i = V.map get (V.fromList names)
3939 Just (UnboxedColumn column) -> toRowValue (column VU. ! i)
4040
4141mkRowRep :: DataFrame -> S. Set T. Text -> Int -> Row
42- mkRowRep df names i = V. generate (S. size names) (\ index -> get index (names' V. ! index))
42+ mkRowRep df names i = V. generate (S. size names) (\ index -> get (names' V. ! index))
4343 where
4444 inOrderIndexes = map fst $ L. sortBy (compare `on` snd ) $ M. toList (columnIndices df)
4545 names' = V. fromList [n | n <- inOrderIndexes, S. member n names]
@@ -48,23 +48,23 @@ mkRowRep df names i = V.generate (S.size names) (\index -> get index (names' V.!
4848 ++ " has less items than "
4949 ++ " the other columns at index "
5050 ++ show i
51- get index name = case getColumn name df of
52- Just (BoxedColumn c) -> case c V. !? index of
51+ get name = case getColumn name df of
52+ Just (BoxedColumn c) -> case c V. !? i of
5353 Just e -> toRowValue e
5454 Nothing -> throwError name
55- Just (UnboxedColumn c) -> case c VU. !? index of
55+ Just (UnboxedColumn c) -> case c VU. !? i of
5656 Just e -> toRowValue e
5757 Nothing -> throwError name
58- Just (GroupedBoxedColumn c) -> case c V. !? index of
58+ Just (GroupedBoxedColumn c) -> case c V. !? i of
5959 Just e -> toRowValue e
6060 Nothing -> throwError name
61- Just (GroupedUnboxedColumn c) -> case c V. !? index of
61+ Just (GroupedUnboxedColumn c) -> case c V. !? i of
6262 Just e -> toRowValue e
6363 Nothing -> throwError name
6464
6565sortedIndexes' :: Bool -> V. Vector Row -> VU. Vector Int
6666sortedIndexes' asc rows = runST $ do
6767 withIndexes <- VG. thaw (V. indexed rows)
68- VA. sortBy (\ (a, b) (a', b') -> ( if asc then compare else flip compare ) b b' ) withIndexes
68+ VA. sortBy (( if asc then compare else flip compare ) `on` snd ) withIndexes
6969 sorted <- VG. unsafeFreeze withIndexes
7070 return $ VU. generate (VG. length rows) (\ i -> fst (sorted VG. ! i))
0 commit comments