[erl-frontend] Extract type checking into helper function
[erl-frontend] Extract type checking into helper function

Summary: Checking for the type of a value was a repetitive pattern so I extracted it.

Reviewed By: rgrig

Differential Revision: D31236585

fbshipit-source-id: 523f39115

facebook/infer,jvillard/infer,jvillard/infer,jvillard/infer,facebook/infer,jvillard/infer,facebook/infer,facebook/infer,jvillard/infer,facebook/infer,jvillard/infer,facebook/infer,jvillard/infer,facebook/infer