getContents, getLine, etc.
Malcolm Wallace
Malcolm.Wallace@cs.york.ac.uk
Fri, 1 Aug 2003 11:02:02 +0100
This is a multi-part message in MIME format.
--Multipart_Fri__1_Aug_2003_11:02:02_+0100_0822d9a0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
"Wojciech Moczydlowski, Jr" <khaliff@astercity.net> writes:
> However, backspace doesn't work, no matter which
> function(getContents, getLine) I use, which makes debugging and normal work
> with the program a nightmare. Does anyone know any workaround (i.e. sensible
> replacement to getLine) apart from switching to ghc and using the readline
> library?
I recently posted the attached "SimpleLineEditor" module to the Haskell
libraries mailing list. To use the module in Hugs, you probably need
to run it through cpp before loading it. Then, call
initialise :: IO ()
before reading the terminal, and
restore :: IO ()
afterwards, and the replacement for Prelude.getLine is
getLineEdited :: String -> IO (Maybe String)
where the string argument is the prompt for the user.
Regards,
Malcolm
--Multipart_Fri__1_Aug_2003_11:02:02_+0100_0822d9a0
Content-Type: text/plain;
name="SimpleLineEditor.hs"
Content-Disposition: attachment;
filename="SimpleLineEditor.hs"
Content-Transfer-Encoding: base64
ey0jIE9QVElPTlMgLWNwcCAjLX0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLS0gfAotLSBNb2R1bGUg
ICAgICA6ICBTeXN0ZW0uQ29uc29sZS5TaW1wbGVMaW5lRWRpdG9yCi0tIENvcHlyaWdodCAgIDog
IChjKSAyMDAwLDIwMDMsIE1hbGNvbG0gV2FsbGFjZQotLSBMaWNlbnNlICAgICA6ICBHUEwgKGlm
IGl0IGRlcGVuZHMgb24gcmVhZGxpbmUsIHdoaWNoIGlzIEdQTCkKLS0gICAgICAgICAgICAgICAg
QlNEIChvdGhlcndpc2UpCi0tCi0tIE1haW50YWluZXIgIDogIGxpYnJhcmllc0BoYXNrZWxsLm9y
ZwotLSBTdGFiaWxpdHkg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ERlbGV0ZSBCZWdpbiAtPiBkZWxDaGFycyBzID4+IGdsICIiIDAgaGlzdAogICAg
ICAgIE1vdmUgTCAgIC0+IGlmIG5vdCAobnVsbCBzKSB0aGVuIHB1dFN0ciAoIlxCUyIpID4+IGds
IHMgMSBoaXN0CiAgICAgICAgICAgICAgICAgICAgZWxzZSBnbCBzIDAgaGlzdAogICAgICAgIEhp
c3RvcnkgIC0+IGNhc2UgaGlzdCBvZgogICAgICAgICAgICAgICAgICAgICAgKGZ1dCwgW10pICAg
ICAtPiBnbCBzIDAgaGlzdAogICAgICAgICAgICAgICAgICAgICAgKGZ1dCwgcDpwYXN0KSAtPiBk
byBkZWxDaGFycyBzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1
dFN0ciAocmV2ZXJzZSBwKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICBnbCBwIDAgKHM6ZnV0LCBwYXN0KQogICAgICAgIEZ1dHVyZSAgIC0+IGNhc2UgaGlzdCBvZgog
ICAgICAgICAgICAgICAgICAgICAgKFtdLCBwYXN0KSAgICAtPiBnbCBzIDAgaGlzdAogICAgICAg
ICAgICAgICAgICAgICAgKGY6ZnV0LCBwYXN0KSAtPiBkbyBkZWxDaGFycyBzCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFN0ciAocmV2ZXJzZSBmKQogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbCBmIDAgKGZ1dCwgczpwYXN0KQog
ICAgICAgIF8gICAgICAgIC0+IGdsIHMgMCBoaXN0CgogICAgZ2wgcyBuIGhpc3QgPSBkbwktLSBz
IGlzIGFjY3VtdWxhdGVkIGxpbmUsIG4oLz0wKSBpcyBjdXJzb3IgcG9zaXRpb24KICAgICAgY21k
IDwtIGxpbmVDbWQKICAgICAgY2FzZSBjbWQgb2YKICAgICAgICBDaGFyIGMgICAtPiBkbyBwdXRT
dHIgKGM6IHJldmVyc2UgKHRha2UgbiBzKSkKICAgICAgICAgICAgICAgICAgICAgICBwdXRTdHIg
KHJlcGxpY2F0ZSBuICdcQlMnKQogICAgICAgICAgICAgICAgICAgICAgIGdsICh0YWtlIG4gcyAr
KyBjOiBkcm9wIG4gcykgbiBoaXN0CiAgICAgICAgQWNjZXB0ICAgLT4gcmV0dXJuIChKdXN0IChy
ZXZlcnNlIHMpKQogICAgICAgIENhbmNlbCAgIC0+IHJldHVybiBOb3RoaW5nCiAgICAgICAgTW92
ZSBSICAgLT4gZG8gbGV0IG4xID0gbi0xCiAgICAgICAgICAgICAgICAgICAgICAgcHV0U3RyIChy
ZXZlcnNlICh0YWtlIG4gcykrKyIgIikKICAgICAgICAgICAgICAgICAgICAgICBwdXRTdHIgKHJl
cGxpY2F0ZSBuICdcQlMnKQogICAgICAgICAgICAgICAgICAgICAgIGdsIHMgbjEgaGlzdAogICAg
ICAgIERlbGV0ZSBSIC0+IGRvIGxldCBuMSA9IG4tMQogICAgICAgICAgICAgICAgICAgICAgIHB1
dFN0ciAocmV2ZXJzZSAodGFrZSBuMSBzKSArKyAiICIpCiAgICAgICAgICAgICAgICAgICAgICAg
cHV0U3RyIChyZXBsaWNhdGUgKG4xKzEpICdcQlMnKQogICAgICAgICAgICAgICAgICAgICAgIGds
ICh0YWtlIG4xIHMgKysgZHJvcCBuIHMpIG4xIGhpc3QKICAgICAgICBNb3ZlIEwgICAtPiBkbyBs
ZXQgbjEgPSBuKzEKICAgICAgICAgICAgICAgICAgICAgICBpZiBuMSA8PSBsZW5ndGggcyB0aGVu
IGRvCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFN0ciAoJ1xCUyc6cmV2ZXJzZSAodGFr
ZSBuMSBzKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0U3RyIChyZXBsaWNhdGUgbjEg
J1xCUycpCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGdsIHMgbjEgaGlzdAogICAgICAgICAg
ICAgICAgICAgICAgICAgZWxzZSBkbwogICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRTdHIg
KHJldmVyc2UgcysrIiAiKQogICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRTdHIgKHJlcGxp
Y2F0ZSBuMSAnXEJTJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2wgcyBuIGhpc3QKICAg
ICAgICBEZWxldGUgTCAtPiBkbyBsZXQgbjEgPSBuKzEKICAgICAgICAgICAgICAgICAgICAgICBp
ZiBuMSA8PSBsZW5ndGggcyB0aGVuIGRvCiAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFN0
ciAoJ1xCUyc6cmV2ZXJzZSAodGFrZSBuIHMpKysiICIpCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgIHB1dFN0ciAocmVwbGljYXRlIG4xICdcQlMnKQogICAgICAgICAgICAgICAgICAgICAgICAg
ICBnbCAodGFrZSBuIHMgKysgZHJvcCBuMSBzKSBuIGhpc3QKICAgICAgICAgICAgICAgICAgICAg
ICAgIGVsc2UgZG8KICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0U3RyIChyZXZlcnNlIHMr
KyIgIikKICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0U3RyIChyZXBsaWNhdGUgbjEgJ1xC
UycpCiAgICAgICAgICAgICAgICAgICAgICAgICAgIGdsIHMgbiBoaXN0CiAgICAgICAgSGlzdG9y
eSAgLT4gY2FzZSBoaXN0IG9mCiAgICAgICAgICAgICAgICAgICAgICAoZnV0LCBbXSkgICAgIC0+
IGdsIHMgbiBoaXN0CiAgICAgICAgICAgICAgICAgICAgICAoZnV0LCBwOnBhc3QpIC0+IGRvIHB1
dFN0ciAocmVwbGljYXRlIG4gJyAnKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBkZWxDaGFycyBzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIHB1dFN0ciAocmV2ZXJzZSBwKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBnbCBwIDAgKHM6ZnV0LCBwYXN0KQogICAgICAgIEZ1dHVyZSAgIC0+IGNhc2UgaGlz
dCBvZgogICAgICAgICAgICAgICAgICAgICAgKFtdLCBwYXN0KSAgICAtPiBnbCBzIG4gaGlzdAog
ICAgICAgICAgICAgICAgICAgICAgKGY6ZnV0LCBwYXN0KSAtPiBkbyBwdXRTdHIgKHJlcGxpY2F0
ZSBuICcgJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsQ2hh
cnMgcwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRTdHIgKHJl
dmVyc2UgZikKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2wgZiAw
IChmdXQsIHM6cGFzdCkKICAgICAgICBfICAgICAgICAtPiBnbCBzIG4gaGlzdAoKCi0tIERlZmlu
ZSBhIG1pbmktY29tbWFuZCBsYW5ndWFnZSwgdG8gc2VwYXJhdGUgdGhlIGxleGluZyBvZiBpbnB1
dAotLSBjb21tYW5kcyBmcm9tIHRoZWlyIGludGVycHJldGF0aW9uLiAgTm90ZSB0aGVyZSBpcyBy
b29tIGZvciBleHBhbnNpb24KLS0gaGVyZSwgZS5nLiBjb21tYW5kcyBpbmNsdWRlIHdvcmQtYXQt
YS10aW1lIG1vdmVtZW50LCBidXQgd2UgZG9uJ3QKLS0gY3VycmVudGx5IGhhdmUgYSBrZXkgYmlu
ZGluZyBmb3IgdGhhdC4KZGF0YSBMaW5lQ21kID0gQ2hhciBDaGFyIHwgTW92ZSBDdXJzb3IgfCBE
ZWxldGUgQ3Vyc29yCiAgICAgICAgICAgICB8IEFjY2VwdCB8IENhbmNlbCB8IEhpc3RvcnkgfCBG
dXR1cmUgfCBOb09wCmRhdGEgQ3Vyc29yICA9IEwgfCBSIHwgV29yZEwgfCBXb3JkUiB8IEJlZ2lu
IH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R1cm4gKE1vdmUgTCkKICAgICAgICAgICAgICAgICdD
JyAtPiByZXR1cm4gKE1vdmUgUikKICAgICAgICAgICAgICAgICdBJyAtPiByZXR1cm4gSGlzdG9y
eQogICAgICAgICAgICAgICAgJ0InIC0+IHJldHVybiBGdXR1cmUKICAgICAgICAgICAgICAgICcz
JyAtPiBkbyBjIDwtIGhHZXRDaGFyIHN0ZGluCiAgICAgICAgICAgICAgICAgICAgICAgICAgY2Fz
ZSBjIG9mCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnficgLT4gcmV0dXJuIChEZWxldGUg
UikKICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gICAtPiByZXR1cm4gTm9PcAogICAgICAg
ICAgICAgICAgJzQnIC0+IGRvIGMgPC0gaEdldENoYXIgc3RkaW4KICAgICAgICAgICAgICAgICAg
ICAgICAgICBjYXNlIGMgb2YKICAgICAgICAgICAgICAgICAgICAgICAgICAgICd+JyAtPiByZXR1
cm4gKE1vdmUgRW5kKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgXyAgIC0+IHJldHVybiBO
b09wCiAgICAgICAgICAgICAgICAnMScgLT4gZG8gYyA8LSBoR2V0Q2hhciBzdGRpbgogICAgICAg
ICAgICAgICAgICAgICAgICAgIGNhc2UgYyBvZgogICAgICAgICAgICAgICAgICAgICAgICAgICAg
J34nIC0+IHJldHVybiAoTW92ZSBCZWdpbikKICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8g
ICAtPiByZXR1cm4gTm9PcAogICAgICAgICAgICAgICAgXyAgIC0+IHJldHVybiBOb09wCiAgICAg
ICAgICAnTycgLT4gZG8KICAgICAgICAgICAgICBjIDwtIGhHZXRDaGFyIHN0ZGluCiAgICAgICAg
ICAgICAgY2FzZSBjIG9mCiAgICAgICAgICAgICAgICAnRCcgLT4gcmV0dXJuIChNb3ZlIEwpCiAg
ICAgICAgICAgICAgICAnQycgLT4gcmV0dXJuIChNb3ZlIFIpCiAgICAgICAgICAgICAgICAnQScg
LT4gcmV0dXJuIEhpc3RvcnkKICAgICAgICAgICAgICAgICdCJyAtPiByZXR1cm4gRnV0dXJlCiAg
ICAgICAgICAgICAgICBfICAgLT4gcmV0dXJuIE5vT3AKICAgICAgICAgIF8gICAtPiByZXR1cm4g
Tm9PcAogICAgICBfIC0+IHJldHVybiAoQ2hhciBjKQoKI2VuZGlmIC0tIFVTRV9SRUFETElORQoK
LS0gfCBBIHNpbXBsZSBpbnRlcmFjdGl2ZSB0ZXN0IGZvciB0aGUgbGluZS1lZGl0aW5nIGZ1bmN0
aW9uYWxpdHkuCgotLSAoVGhpcyBpbGx1c3RyYXRlcyB0aGUgbmVjZXNzYXJ5IHVzZSBvZiAnaW5p
dGlhbGlzZScgYW5kICdyZXN0b3JlJwotLSAgYXMgYnJhY2tldHMgYXJvdW5kIHRoZSBlZGl0aW5n
IGxvb3AuKQp0ZXN0SXQgPSBpbml0aWFsaXNlID4+IGxvb3AgPj4gcmVzdG9yZQogIHdoZXJlIGxv
b3AgPSBkbyBsIDwtIGdldExpbmVFZGl0ZWQgInByb21wdD4gIgogICAgICAgICAgICAgICAgICB3
aGVuIChpc0p1c3QgbCkgKHB1dFN0ckxuIChmcm9tSnVzdCBsKSkKICAgICAgICAgICAgICAgICAg
d2hlbiAobC89SnVzdCAicXVpdCIpIGxvb3AK
--Multipart_Fri__1_Aug_2003_11:02:02_+0100_0822d9a0--