I'm looking at this and wondering how the "as pattern" actually is working

compress (x:ys@(y:_))
    | x == y    = compress ys
    | otherwise = x : compress ys
compress ys = ys

I'm sure it's just some version of my stab at eliminating consecutive duplicates in a list

compress :: Eq a => [a] -> [a]
compress [] = []
compress [x] = [x]
compress (x:y:xs) = if x == y then compress (y:xs) else x : compress (y:xs)

only smarter. Could someone walk me through the (x:ys@(y:_)) part?

LB