added foreign channel impl for purescript