Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  help with type error in a wxHaskell program (Kim-Ee Yeoh)
   2. Re:  help with type error in a wxHaskell program (Jason J. Corso)


----------------------------------------------------------------------

Message: 1
Date: Sun, 22 Nov 2015 10:52:13 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] help with type error in a wxHaskell
        program
Message-ID:
        <capy+zdtqzhcof+zwy42jnrxqq7azmxl_kzqxl2xzbb3prfp...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Sat, Nov 21, 2015 at 8:28 PM, Jason J. Corso <[email protected]>
wrote:

> 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
>

This is a consequence of the line "f <- frame" in

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)]

I have no experience at all with wxHaskell. But for the sake of forward
motion, substituting with "f <- frame []" should work.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151122/5ee635e3/attachment-0001.html>

------------------------------

Message: 2
Date: Sun, 22 Nov 2015 06:37:02 -0500
From: "Jason J. Corso" <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] help with type error in a wxHaskell
        program
Message-ID:
        <CANYqXeppRjVZ=sk+jn0qorhkzodcxudn_+r6e3nqd-j57k-...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Thank you both for the help.  There was another mistake after this
piece.  The let s = map... led to a [IO (StaticText())] and it had to
be changed as below.  The below code works.  Thanks again.

module Main where
import Graphics.UI.WX
main :: IO ()
main
    = start gui
gui :: IO ()
gui = do
        f <- frame [text := "First Fix!"]
        ss <- mapM (\t -> staticText f [text := show t]) [1..10]
        set f [layout := margin 10 ( row 2 $ map (\x -> (widget x)) ss)]


Jason



On Sat, Nov 21, 2015 at 10:52 PM, Kim-Ee Yeoh <[email protected]> wrote:
>
> On Sat, Nov 21, 2015 at 8:28 PM, Jason J. Corso <[email protected]>
> wrote:
>>
>> 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
>
>
> This is a consequence of the line "f <- frame" in
>
> 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)]
>
> I have no experience at all with wxHaskell. But for the sake of forward
> motion, substituting with "f <- frame []" should work.
>
> -- Kim-Ee
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 89, Issue 39
*****************************************

Reply via email to