Skip to content

Commit 2d6e7ba

Browse files
committed
chore: Remove unused column functions.
1 parent 5704b55 commit 2d6e7ba

File tree

1 file changed

+0
-133
lines changed

1 file changed

+0
-133
lines changed

src/DataFrame/Internal/Column.hs

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -484,48 +484,6 @@ imapColumn f = \case
484484
}
485485
)
486486

487-
-- | Filter column with index.
488-
ifilterColumn ::
489-
forall a.
490-
(Columnable a) =>
491-
(Int -> a -> Bool) -> Column -> Either DataFrameException Column
492-
ifilterColumn f c@(BoxedColumn (column :: VB.Vector b)) = case testEquality (typeRep @a) (typeRep @b) of
493-
Just Refl -> pure $ BoxedColumn $ VG.ifilter f column
494-
Nothing ->
495-
Left $
496-
TypeMismatchException
497-
( MkTypeErrorContext
498-
{ userType = Right (typeRep @a)
499-
, expectedType = Right (typeRep @b)
500-
, callingFunctionName = Just "ifilterColumn"
501-
, errorColumnName = Nothing
502-
}
503-
)
504-
ifilterColumn f c@(UnboxedColumn (column :: VU.Vector b)) = case testEquality (typeRep @a) (typeRep @b) of
505-
Just Refl -> pure $ UnboxedColumn $ VG.ifilter f column
506-
Nothing ->
507-
Left $
508-
TypeMismatchException
509-
( MkTypeErrorContext
510-
{ userType = Right (typeRep @a)
511-
, expectedType = Right (typeRep @b)
512-
, callingFunctionName = Just "ifilterColumn"
513-
, errorColumnName = Nothing
514-
}
515-
)
516-
ifilterColumn f c@(OptionalColumn (column :: VB.Vector b)) = case testEquality (typeRep @a) (typeRep @b) of
517-
Just Refl -> pure $ OptionalColumn $ VG.ifilter f column
518-
Nothing ->
519-
Left $
520-
TypeMismatchException
521-
( MkTypeErrorContext
522-
{ userType = Right (typeRep @a)
523-
, expectedType = Right (typeRep @b)
524-
, callingFunctionName = Just "ifilterColumn"
525-
, errorColumnName = Nothing
526-
}
527-
)
528-
529487
-- | Fold (right) column with index.
530488
ifoldrColumn ::
531489
forall a b.
@@ -568,48 +526,6 @@ ifoldrColumn f acc c@(UnboxedColumn (column :: VU.Vector d)) = case testEquality
568526
}
569527
)
570528

571-
-- | Fold (left) column with index.
572-
ifoldlColumn ::
573-
forall a b.
574-
(Columnable a, Columnable b) =>
575-
(b -> Int -> a -> b) -> b -> Column -> Either DataFrameException b
576-
ifoldlColumn f acc c@(BoxedColumn (column :: VB.Vector d)) = case testEquality (typeRep @a) (typeRep @d) of
577-
Just Refl -> pure $ VG.ifoldl' f acc column
578-
Nothing ->
579-
Left $
580-
TypeMismatchException
581-
( MkTypeErrorContext
582-
{ userType = Right (typeRep @a)
583-
, expectedType = Right (typeRep @d)
584-
, callingFunctionName = Just "ifoldlColumn"
585-
, errorColumnName = Nothing
586-
}
587-
)
588-
ifoldlColumn f acc c@(OptionalColumn (column :: VB.Vector d)) = case testEquality (typeRep @a) (typeRep @d) of
589-
Just Refl -> pure $ VG.ifoldl' f acc column
590-
Nothing ->
591-
Left $
592-
TypeMismatchException
593-
( MkTypeErrorContext
594-
{ userType = Right (typeRep @a)
595-
, expectedType = Right (typeRep @d)
596-
, callingFunctionName = Just "ifoldlColumn"
597-
, errorColumnName = Nothing
598-
}
599-
)
600-
ifoldlColumn f acc c@(UnboxedColumn (column :: VU.Vector d)) = case testEquality (typeRep @a) (typeRep @d) of
601-
Just Refl -> pure $ VG.ifoldl' f acc column
602-
Nothing ->
603-
Left $
604-
TypeMismatchException
605-
( MkTypeErrorContext
606-
{ userType = Right (typeRep @a)
607-
, expectedType = Right (typeRep @d)
608-
, callingFunctionName = Just "ifoldlColumn"
609-
, errorColumnName = Nothing
610-
}
611-
)
612-
613529
foldlColumn ::
614530
forall a b.
615531
(Columnable a, Columnable b) =>
@@ -739,55 +655,6 @@ headColumn (OptionalColumn (col :: VB.Vector b)) = case testEquality (typeRep @a
739655
}
740656
)
741657

742-
-- | Generic reduce function for all Column types.
743-
reduceColumn ::
744-
forall a b.
745-
(Columnable a, Columnable b) =>
746-
(a -> b) -> Column -> Either DataFrameException b
747-
{-# SPECIALIZE reduceColumn ::
748-
(VU.Vector (Double, Double) -> Double) ->
749-
Column ->
750-
Either DataFrameException Double
751-
, (VU.Vector Double -> Double) -> Column -> Either DataFrameException Double
752-
#-}
753-
reduceColumn f (BoxedColumn (column :: c)) = case testEquality (typeRep @c) (typeRep @a) of
754-
Just Refl -> pure $ f column
755-
Nothing ->
756-
Left $
757-
TypeMismatchException
758-
( MkTypeErrorContext
759-
{ userType = Right (typeRep @a)
760-
, expectedType = Right (typeRep @b)
761-
, callingFunctionName = Just "reduceColumn"
762-
, errorColumnName = Nothing
763-
}
764-
)
765-
reduceColumn f (UnboxedColumn (column :: c)) = case testEquality (typeRep @c) (typeRep @a) of
766-
Just Refl -> pure $ f column
767-
Nothing ->
768-
Left $
769-
TypeMismatchException
770-
( MkTypeErrorContext
771-
{ userType = Right (typeRep @a)
772-
, expectedType = Right (typeRep @b)
773-
, callingFunctionName = Just "reduceColumn"
774-
, errorColumnName = Nothing
775-
}
776-
)
777-
reduceColumn f (OptionalColumn (column :: c)) = case testEquality (typeRep @c) (typeRep @a) of
778-
Just Refl -> pure $ f column
779-
Nothing ->
780-
Left $
781-
TypeMismatchException
782-
( MkTypeErrorContext
783-
{ userType = Right (typeRep @a)
784-
, expectedType = Right (typeRep @b)
785-
, callingFunctionName = Just "reduceColumn"
786-
, errorColumnName = Nothing
787-
}
788-
)
789-
{-# INLINE reduceColumn #-}
790-
791658
-- | An internal, column version of zip.
792659
zipColumns :: Column -> Column -> Column
793660
zipColumns (BoxedColumn column) (BoxedColumn other) = BoxedColumn (VG.zip column other)

0 commit comments

Comments
 (0)