开发者

"readline" (or "haskeline") for Curry?

开发者 https://www.devze.com 2023-02-28 05:49 出处:网络
What\'s the most practical way to write a program in Curry programming language that would have a console UI with decent line editing?

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, and receive his edited variant back, process it (w.r.t. to the current state of the process), then loop.

I like readline-like/haskeline-like editing. (And BTW haskeline in its latest version (0.6.4.0) has exactly the API for what I want: read a line with a suggested initial value -- getInputLineWithInitial:

This function behaves in the exact same manner as getInputLine, except that it pre-populates the input area. The text that resides in the input area is given as a 2-tuple with two Strings. The string on the left of the tuple开发者_如何学编程 is what will appear to the left of the cursor and the string on the right is what will appear to the right of the cursor.

)

How to get the wanted functionality for a Curry program in the most practical way (I mean, I'd like not to write new code in Curry for the console editing operations, but rather perhaps use a library, or a wrapper, or FFI)?

0

精彩评论

暂无评论...
验证码 换一张
取 消