Skip to content

Commit a9e93bf

Browse files
author
Răzvan C. Rădulescu
authored
Consistent Interface parameter placement (#23)
Make API functions consistent by placing `Interface` parameter at the end of the argument list.
1 parent 138cb52 commit a9e93bf

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/Node/ReadLine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ exports.setPrompt = function (prompt) {
5252
};
5353
};
5454

55-
exports.setLineHandler = function (readline) {
56-
return function (callback) {
55+
exports.setLineHandler = function (callback) {
56+
return function (readline) {
5757
return function () {
5858
readline.removeAllListeners("line");
5959
readline.on("line", function (line) {

src/Node/ReadLine.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type Completer
6565
-- | Builds an interface with the specified options.
6666
createInterface
6767
:: forall r
68-
. Readable r
68+
. Readable r
6969
-> Options InterfaceOptions
7070
-> Effect Interface
7171
createInterface input opts = createInterfaceImpl
@@ -110,6 +110,6 @@ type LineHandler a = String -> Effect a
110110
-- | Set the current line handler function.
111111
foreign import setLineHandler
112112
:: forall a
113-
. Interface
114-
-> LineHandler a
113+
. LineHandler a
114+
-> Interface
115115
-> Effect Unit

test/Main.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ main = do
1212
interface <- createConsoleInterface noCompletion
1313
setPrompt "> " interface
1414
prompt interface
15-
setLineHandler interface $ \s ->
15+
interface # setLineHandler \s ->
1616
if s == "quit"
17-
then close interface
18-
else do
19-
log $ "You typed: " <> s
20-
prompt interface
17+
then close interface
18+
else do
19+
log $ "You typed: " <> s
20+
prompt interface

0 commit comments

Comments
 (0)