{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module HaskellWorks.Data.RankSelect.Base.Rank
(
Rank(..)
) where
import HaskellWorks.Data.Positioning
import HaskellWorks.Data.RankSelect.Base.Rank0
import HaskellWorks.Data.RankSelect.Base.Rank1
class Eq a => Rank v a where
rank :: a -> v -> Count -> Count
instance Rank [Bool] Bool where
rank :: Bool -> [Bool] -> Count -> Count
rank Bool
a = if Bool
a then [Bool] -> Count -> Count
forall v. Rank1 v => v -> Count -> Count
rank1 else [Bool] -> Count -> Count
forall v. Rank0 v => v -> Count -> Count
rank0
{-# INLINABLE rank #-}