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

How to use SUM() in MySQL for calculated values -

ios - IBOutlet for image button not correctly referencing button after recreating outlet -

java - AEM: 403 Forbidden occurs when call a Post servlet -