Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sven Tennie
haskeline
Commits
5b25cf1f
Commit
5b25cf1f
authored
Jan 21, 2019
by
Judah Jacobson
Browse files
Rename to `waitForAnyKey`
parent
530c38ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
System/Console/Haskeline.hs
View file @
5b25cf1f
...
...
@@ -47,7 +47,7 @@ module System.Console.Haskeline(
getInputLineWithInitial
,
getInputChar
,
getPassword
,
waitForKey
,
waitFor
Any
Key
,
-- ** Outputting text
-- $outputfncs
outputStr
,
...
...
@@ -233,7 +233,7 @@ acceptOneChar = choiceCmd [useChar $ \c s -> change (insertChar c) s
----------
{- | Waits for one key to be pressed, then returns. Ignores the value
of the
input
key.
of the
specific
key.
Returns 'True' if it successfully accepted one key. Returns 'False'
if it encountered the end of input; i.e., an @EOF@ in file-style interaction,
...
...
@@ -242,10 +242,10 @@ or a @Ctrl-D@ in terminal-style interaction.
When using file-style interaction, consumes a single character from the input which may
be non-printable.
-}
waitForKey
::
(
MonadIO
m
,
MonadMask
m
)
waitFor
Any
Key
::
(
MonadIO
m
,
MonadMask
m
)
=>
String
-- ^ The input prompt
->
InputT
m
Bool
waitForKey
=
promptedInput
getAnyKeyCmd
waitFor
Any
Key
=
promptedInput
getAnyKeyCmd
$
\
fops
->
fmap
isJust
.
runMaybeT
$
getLocaleChar
fops
getAnyKeyCmd
::
(
MonadIO
m
,
MonadMask
m
)
=>
TermOps
->
Prefix
->
InputT
m
Bool
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment