Can someone please explain how Read/Show works.. I cannot find any tutorials on it. I’ve been searching through crappy haskell documentation for 4 days now and i’m getting very frustrated.
Could someone please be a savior tonight and help me convert a int to a string so I can reverse the string value.
Thank you.
Edit.. adding my current code..
mult_add d s = d + 10*s
form_number_back d = foldr mult_add 0 d
form_number_front d = reverse[(show $ read (form_number_back(d)))]
readconverts a string to an Int (in your case), whereasshowconverts an Int to a string.It looks like
form_number_backreturns anInt, so you just need toshowit, notreadit.Also,
showreturns a string (in your case,[Char]) so there’s no need to put another[...]around the result.