Mark's Idris solution https://gist.githubusercontent.com/markhibberd/8edfa6cd11103f8c0dab/raw/35ce925b44ea2ad204bd9ce938c226c9e0ccb846/TicTacType.idr