@[inline]
fn char(ch u8) fn (string) !(u8, string) {
	return fn [ch] (input string) !(u8, 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]
	}
}
