Zafar Ansari had played three Tests for England against Bangladesh and India but has retired early into his career to pursue other opportunities.