I have three functions that find the nth element of a list:
nthElement :: [a] -> Int -> Maybe a
nthElement [] a = Nothing
nthElement (x:xs) a | a <= 0
This is just a matter of ordering but I think its very readable and has the same structure as guards.
nthElement :: [a] -> Int -> Maybe a
nthElement [] a = Nothing
nthElement (x:xs) a = if a < 1 then Nothing else
if a == 1 then Just x
else nthElement xs (a-1)
The last else doesn't need and if since there is no other possibilities, also functions should have "last resort case" in case you missed anything.