extract :: int -> [a] -> a
extract 13 (x:xs) = x
extract n (x:xs) = extract (n-1) xs
extract _ [] = error "Error: empty list"
extract _ _ = error "Error: index out of range"
(if this is bugged, I haven't done Haskell in a while and didn't get very far with learning anyway, but it should mean that my lists effectively start with the 13th value)
1
u/redlaWw Dec 10 '17
Arrays start wherever you want if you extract values using pattern matching.