haskell - Convert a entryGetText into Int gtk2hs -


i'm trying convert entrytext string, can use other functions.

`unsafeperformio (entrygettext txtmagn)` 

while trying compile code, error message:

`couldn't match type ‘io a0 -> a0’ ‘[char]’     expected type: string       actual type: io a0 -> a0     probable cause: ‘unsafeperformio’ applied few arguments     in first argument of ‘putstrln’, namely ‘unsafeperformio’` 

thanks in advance

this because wrote

putstrln unsafeperformio (entrygettext txtmagn) 

here pass unsafeperformio putstrln parameter. meant:

putstrln (unsafeperformio (entrygettext txtmagn)) 

now unsafeperformio. name suggests, unsafe, you'd better have clear idea trying accomplish. safely pull out value out of io , use later:

text <- entrygettext txtmagn putstrln text 

Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -