<br><span style="color: rgb(72, 74, 76); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px;"></span><div class="post_region_text" id="questionText" style="margin: 5px 0px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 13px;"><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">here is the question:</p><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">Write a function <code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: rgb(221, 17, 68); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(247, 247, 249); border: 1px solid rgb(225, 225, 232);">showAreaOfCircle</code> which, given the radius of a circle, calculates the area of the circle,</p><blockquote style="padding: 0px 0px 0px 15px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-left-color: rgb(238, 238, 238);"><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; background-color: rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.14902);"><code>showAreaOfCircle 12.3</code>  ⇒ <code>"The area of a circle with radius 12.3cm is about 475.2915525615999 cm^2"</code></pre></blockquote><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">my solution is:</p><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; background-color: rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.14902);">showAreaOfCircle :: Show a => a -> String
showAreaOfCircle x = "The area of a circle with radius" ++ show x ++ "is about" ++ " " + show(pi * x * x) ++ "cm^2"</pre><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">but there is an error</p><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">• Could not deduce (Num a) arising from a use of ‘*’<br>from the context: Show a<br>bound by the type signature for:<br>showAreaOfCircle :: forall a. Show a => a -> String<br>at FirstStep.hs:20:1-41<br>Possible fix:<br>add (Num a) to the context of <br>the type signature for:<br>showAreaOfCircle :: forall a. Show a => a -> String<br>• In the first argument of ‘show’, namely ‘(pi * x * x)’<br>In the second argument of ‘(+)’, namely ‘show (pi * x * x)’<br>In the second argument of ‘(++)’, namely ‘" " + show (pi * x * x)’</p><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">I had tried to change the type declaration to </p><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; background-color: rgb(245, 245, 245); border: 1px solid rgba(0, 0, 0, 0.14902);">Show a => Num a => a -> String</pre><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">i guess there must be a problem with pi.</p><p style="margin: 0px 0px 2px; word-break: break-word; min-height: 15px;">Can someone help me with the error message? Great thanks</p></div>