Concerning the writing of a function in Haskell, using Gtk (via the package Gtk2Hs); here are my requirements:
The function should have the signature:
affiche :: ((Double,Double), (Double,Double)) -> IO Bool
The parameters are noted (a0, a), (b0, b); the function should use an external function called mandelbrot: if mandelbrot (a, b) is true, then there must be a call to: postGUIAsync affiche2 a0 b0, where affiche2 is (I also introduced my try to write affiche):
affiche2 :: Double -> Double -> Render() affiche2 a b = do C.rectangle a b 1 1 stroke affiche :: ((Double,Double), (Double,Double)) -> IO Bool affiche ((a0,a), (b0,b)) = when (mandelbrot a b) $ affiche2 a0 b0
My attempt to write affiche does not use postGUIAsync, and it raises the error:
Error: Couldn't match type ‘Render’ with ‘IO’
Expected type: IO Bool
Actual type: Render ()