fun with anyContT lexical scoping; use bracket for extra memory-management protection
removed import of unicode-unsafe string functions