Idris HEAD seems to require some hints to make toState' and fromState' type-check