Questions tagged [haskeline]
25 questions
24
votes
1 answer
Haskell (haskeline) word completion
Haskeline makes it very easy to get filename tab-completion functionality:
module Main where
import System.Console.Haskeline
import System.Environment
mySettings :: Settings IO
mySettings = defaultSettings {historyFile = Just "myhist"}
main :: IO…

amindfv
- 8,438
- 5
- 36
- 58
12
votes
1 answer
Haskell: GHCi treats Ctrl-Y like Ctrl-Z
According to the haskeline documentation, typing CTRL+Y should pop the most recent entry from the kill-ring (e.g. the line I just deleted via CTRL+U). I'm finding that instead, it suspends the REPL, as if I'd typed CTRL+Z.
As a clumsy workaround,…

ivan
- 6,032
- 9
- 42
- 65
10
votes
1 answer
How to make ghci support ^p to go up?
I use Ctrl p a lot instead of up arrow to go up on Terminal. How to make ghci support Ctrl p to go up?
I use ghci from ghc98 from port. Mac OS X 10.5.8.

Kit
- 101
- 2
9
votes
1 answer
Updating outputted text in haskeline
Haskeline provides the functions outputStr and outputStrLn, which output to stdout, but is there a way to update text that's already been outputted? I'm thinking of, for example, when an installer displays the current percentage installed -- the…

amindfv
- 8,438
- 5
- 36
- 58
7
votes
1 answer
Perform simple IO in Haskeline, inside InputT monad, without having to resort to unsafePerformIO
Given the proof of concept code below I'd like to be able to somehow perform my foo function with the ability to output the string Paul! and the possibility of getting its return value inside the InputT monad-transformer without using…

Paul
- 20,883
- 7
- 57
- 74
5
votes
0 answers
Why use Haskeline's outputStrLn vs. conventional putStrLn?
My question: Is there any advantage to using Haskeline's outputStrLn over putStrLn for writing to the screen in a terminal program?
Background:
I recently introduced Haskeline into my terminal app in order to leverage the line-editing UI of the…

the-konapie
- 601
- 3
- 10
5
votes
2 answers
Haskell Best Practise: Early termination in Haskeline
I am using the Haskeline package and I want to get three strings in a row from the command line before I do anything and I have come up with what seems to be a neat solution to me. But I am sure that there might be a better way to do it. I am…

Robert Massaioli
- 13,379
- 7
- 57
- 73
5
votes
2 answers
Ambiguous type variable with Haskeline auto-completion
I'm trying to implement an autocompletion function with Haskeline :
import System.Console.Haskeline
import System.Console.Haskeline.IO
import Data.List
mySettings :: Settings IO
mySettings = defaultSettings {
…

JeanJouX
- 2,555
- 1
- 25
- 37
5
votes
1 answer
calling network IO from within haskeline
I have an existing program which takes command line arguments (username, password, date) and then uses the Network.HTTP.Conduit library to post an xml message to a server. I then parse the results, do some work and use blaze-html to write out to a…

Neil
- 345
- 1
- 11
4
votes
1 answer
How to change Tab-completed content at runtime in Haskeline?
I want to write a text interface, which provides some default commands. This program supports tab completion of those commands.
This program also records user inputs and stores it in StateData. And now I want this program to support tab completion…

ecburx
- 45
- 1
- 5
4
votes
1 answer
Use the input from Haskeline's getInputLine
I have the code
main :: IO()
main = runInputT defaultSettings loop
where
--loop :: InputT IO ()
loop = do
minput <- getInputLine…

Wolfe
- 107
- 1
- 3
4
votes
0 answers
Haskeline from separate thread
I am writing an OpenGL game and am about to start writing the code for a
Quake-like console (a la Quake 2/Counter-Strike, where you press tilde
(~) and a console interface drops down). I have already used the
Haskeline library for a plain text-based…

Linus Arver
- 1,331
- 1
- 13
- 18
3
votes
1 answer
Unsafe IO Or: Haskeline and Directories
DISCLAIMER: I am somewhat new to Haskell.
I am writing an interpreter, or, in this context, a REPL. For that purpose I am using haskeline, which is nice for REPLs. It has the capability of storing the command line history within a file, which is…

hellerve
- 508
- 1
- 6
- 30
2
votes
0 answers
"readline" (or "haskeline") for Curry?
What's the most practical way to write a program in Curry programming language that would have a console UI with decent line editing?
Actually, I need to pass a string as a suggestion for the user's input, then let the user edit it in the console,…

imz -- Ivan Zakharyaschev
- 4,921
- 6
- 53
- 104
2
votes
2 answers
Haskell: how to use haskeline and write to a file in the same program
I wrote a program in Haskell that builds a guitar tab as a txt file in the current directory. It gets a String of chords from the user, and then builds the proper output and writes it line by line to a file.
I wasn't able to use the backspace key on…

BabaSvoloch
- 301
- 3
- 20