{-# LANGUAGE FlexibleInstances     #-}
{-# LANGUAGE MultiParamTypeClasses #-}

module HaskellWorks.Data.RankSelect.Base.Select
    ( -- * Rank & Select
      Select(..)
    ) where

import HaskellWorks.Data.Positioning
import HaskellWorks.Data.RankSelect.Base.Select0
import HaskellWorks.Data.RankSelect.Base.Select1

class Eq a => Select v a where
  select :: a -> v -> Count -> Count

instance Select [Bool] Bool where
  select :: Bool -> [Bool] -> Count -> Count
select Bool
a = if Bool
a then [Bool] -> Count -> Count
forall v. Select1 v => v -> Count -> Count
select1 else [Bool] -> Count -> Count
forall v. Select0 v => v -> Count -> Count
select0
  {-# INLINABLE select #-}