Rewriting the Futhark Type Checker