ML code for the post Categories as Types