@musicmatze I'm not sure what it would mean to not use library functions. This uses just the Prelude, ( and therefore linked-lists under the hood, which is silly but would technically work)
```
indexOf :: Ord a => [a] -> a -> Maybe Int
indexOf [] _ = Nothing
indexOf xs y =
let i = (length xs) `div` 2
choice LT = indexOf (take i xs) y
choice EQ = Just i
choice GT = indexOf (drop (i + 1) xs) y
in choice $ compare y (xs !! i)
```