[Haskell-beginners] help with type error in a wxHaskell program
toad3k at gmail.com
Sat Nov 21 15:02:39 UTC 2015
The type of frame according to the documentation is frame :: [Prop
())] -> IO
()). Maybe the documentation you are looking at is out of date?
On Sat, Nov 21, 2015 at 8:28 AM, Jason J. Corso <jjcorso at eecs.umich.edu>
> I'm new to Haskell and to wxHaskell (but found playing with wxHaskell
> to be a nice mid-ground between my years of imperative experience and
> the pure functional). Thanks for the help.
> I wrote the following code to create a set of staticText widgets by
> mapping the layout over a list. Easy enough...
> module Main where
> import Graphics.UI.WX
> main :: IO ()
> = start gui
> gui :: IO ()
> gui = do
> f <- frame
> let s = map (\t -> staticText f [text := show t]) [1..10]
> set f [layout := margin 10 ( row 2 $ map (\x -> (widget x)) s)]
> But, I get a type error that I do not understand
> Couldn't match expected type ‘IO (Window a0)’
> with actual type ‘[Prop (Frame ())] -> IO (Frame ())’
> Probable cause: ‘frame’ is applied to too few arguments
> Thank you in advance,
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners