# Converting IO Int --> Int

Tim Stitt tim.stitt at uwimona.edu.jm
Sun Nov 9 14:36:08 EST 2003

```Can anyone tell me how to convert a value of type IO Int to a value of ty=
pe
Int.=0D
=0D
I wrote a simple script to read an integer from the user using IO and the=
n
the value is returned from the IO function using =0D
=0D
return value=0D
=0D
with a return type of IO Int.=0D
=0D
In the calling function I wish to do a comparison with the user value and=
a
hard-coded integer. Unfortunately I keep getting type errors between the =
Int
and the IO Int.=0D
=0D
I would be grateful for any assistance in this.=0D
=0D
{"ft_lang_label":"__label__en","ft_lang_prob":0.73915964,"math_prob":0.74906677,"size":695,"snap":"2020-45-2020-50","text_gpt3_token_len":217,"char_repetition_ratio":0.14182344,"word_repetition_ratio":0.0,"special_character_ratio":0.2733813,"punctuation_ratio":0.071428575,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97901475,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-29T17:43:52Z\",\"WARC-Record-ID\":\"<urn:uuid:bf919aea-0e23-489a-b0a4-dca297c481aa>\",\"Content-Length\":\"3010\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:78a2c264-3b88-4ca0-b56a-2c854cb5e3d7>\",\"WARC-Concurrent-To\":\"<urn:uuid:4178d9e4-2ccf-4bda-b106-7d1110fd9640>\",\"WARC-IP-Address\":\"23.253.242.70\",\"WARC-Target-URI\":\"https://mail.haskell.org/pipermail/haskell-cafe/2003-November/005479.html\",\"WARC-Payload-Digest\":\"sha1:4UWQ3TC7O7VPMWCPUPZH34MJQMB7C6GL\",\"WARC-Block-Digest\":\"sha1:U5XQBNLVRCKMG6ZR6BXCJEJCXF7PQHSO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141201836.36_warc_CC-MAIN-20201129153900-20201129183900-00046.warc.gz\"}"}