Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Node/ReadLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ exports.setPrompt = function (prompt) {
};
};

exports.setLineHandler = function (readline) {
return function (callback) {
exports.setLineHandler = function (callback) {
return function (readline) {
return function () {
readline.removeAllListeners("line");
readline.on("line", function (line) {
Expand Down
6 changes: 3 additions & 3 deletions src/Node/ReadLine.purs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type Completer
-- | Builds an interface with the specified options.
createInterface
:: forall r
. Readable r
. Readable r
-> Options InterfaceOptions
-> Effect Interface
createInterface input opts = createInterfaceImpl
Expand Down Expand Up @@ -110,6 +110,6 @@ type LineHandler a = String -> Effect a
-- | Set the current line handler function.
foreign import setLineHandler
:: forall a
. Interface
-> LineHandler a
. LineHandler a
-> Interface
-> Effect Unit
10 changes: 5 additions & 5 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ main = do
interface <- createConsoleInterface noCompletion
setPrompt "> " interface
prompt interface
setLineHandler interface $ \s ->
interface # setLineHandler \s ->
if s == "quit"
then close interface
else do
log $ "You typed: " <> s
prompt interface
then close interface
else do
log $ "You typed: " <> s
prompt interface