RankNTypes and ConstraintKinds to the rescue

Using RankNTypes and ConstraintKinds we can define a generic enumApply function.
Fix formatting