module Data.Array.Comfort.Shape.Utility where

import Text.Printf (printf)


messageIndexFromOffset :: String -> Int -> String
messageIndexFromOffset :: String -> Int -> String
messageIndexFromOffset String
name Int
k =
   forall r. PrintfType r => String -> r
printf String
"indexFromOffset (%s): index %d out of range" String
name Int
k

errorIndexFromOffset :: String -> Int -> a
errorIndexFromOffset :: forall a. String -> Int -> a
errorIndexFromOffset String
name = forall a. HasCallStack => String -> a
error forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Int -> String
messageIndexFromOffset String
name


isRight :: Either a b -> Bool
isRight :: forall a b. Either a b -> Bool
isRight = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (forall a b. a -> b -> a
const Bool
False) (forall a b. a -> b -> a
const Bool
True)