rework curry to return function type, general monad functions

Signed-off-by: Andrew <a@0x41.co>