module Data.Array.Comfort.Shape.Set where

import qualified Data.Set as Set
import Data.Set (Set)


offset, uncheckedOffset :: Ord a => Set a -> a -> Int
offset :: Set a -> a -> Int
offset = (a -> Set a -> Int) -> Set a -> a -> Int
forall a b c. (a -> b -> c) -> b -> a -> c
flip a -> Set a -> Int
forall a. Ord a => a -> Set a -> Int
Set.findIndex
uncheckedOffset :: Set a -> a -> Int
uncheckedOffset = Set a -> a -> Int
forall a. Ord a => Set a -> a -> Int
offset

indexFromOffset, uncheckedIndexFromOffset :: Set a -> Int -> a
indexFromOffset :: Set a -> Int -> a
indexFromOffset = (Int -> Set a -> a) -> Set a -> Int -> a
forall a b c. (a -> b -> c) -> b -> a -> c
flip Int -> Set a -> a
forall a. Int -> Set a -> a
Set.elemAt
uncheckedIndexFromOffset :: Set a -> Int -> a
uncheckedIndexFromOffset = Set a -> Int -> a
forall a. Set a -> Int -> a
indexFromOffset