-- | Get index of an element from a list, throw meaningful error upon failure
unsafeElemIndex
    :: (Eq a, Show a)
    => a
    -> [a]
    -> Int
unsafeElemIndex x xs =
    maybe
        (error $ "expected '" <> show x <> "' to be an element of " <> show xs)
        identity
        (x `elemIndex` xs)
unsafeElemIndex
    :: (Eq a, Show a)
    => a
    -> [a]
    -> Int
unsafeElemIndex x xs =
    maybe
        (error $ "expected '" <> show x <> "' to be an element of " <> show xs)
        identity
        (x `elemIndex` xs)
unsafeElemIndex x xs =
    maybe
        (error $ "expected '" <> show x <> "' to be an element of " <> show xs)
        identity
        (x `elemIndex` xs)