Use applicative instead of case hack

Signed-off-by: Ricky Elrod <ricky@elrod.me>