Prototyping a smart card architecture in a lazy functional language