
@[inline]
fn char(ch byte) fn (string) !(byte, string) {
	return fn [ch] (input string) !(byte, string) {
		return if input[0] == ch {
			ch, input[1..]
		} else {
			error('Some error')
		}
	}
}

fn main() {
	a_char := int('a'[0])
	inputs := ['a', 'abc']
	remains := ['', 'bc']

	for i, input in inputs {
		got, remain := a_char(input)!

		assert got == 'a'[0]
		assert remain == remains[i]
	}
}
