parseInstruction = R.pipe(
token => /^(?<instruction>\w+)\s?(?<argument>.+)?$/.exec(token),
R.tap(token => console.log(token)),
x => x.groups,
({instruction, argument}) => instruction.startsWith('add')
? {type: 'add', register: instruction.replace('add', '').toUpperCase(), value: parseInt(argument)}
: {type: instruction}
)