tag:blogger.com,1999:blog-21123659.post5567627060839063521..comments2023-05-03T09:30:17.042+02:00Comments on koweycode: XTC on hackagekoweyhttp://www.blogger.com/profile/11175806459477851520noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-21123659.post-13679446470699526042008-03-21T14:17:00.000+01:002008-03-21T14:17:00.000+01:00Thanks for the clarifications, Martijn.By the way,...Thanks for the clarifications, Martijn.<BR/><BR/>By the way, if you have any improvements you would like to see in wxHaskell, we'd love to hear about them, either on our mailing list or on our tracker http://sourceforge.net/tracker/?group_id=73133koweyhttps://www.blogger.com/profile/11175806459477851520noreply@blogger.comtag:blogger.com,1999:blog-21123659.post-56690036232112967852008-03-21T12:03:00.000+01:002008-03-21T12:03:00.000+01:00The typed values have a maybe type to account for ...The typed values have a maybe type to account for parse errors in the value entry. For example, if you have a value entry of type Int and you enter characters, get typedValue returns Nothing. For the other widgets, only ListView and ChoiceView use a maybe (i.e. typedMaybeSelection), since their selections may be empty. RadioViews indeed cannot be uninitialized, and therefore use typedSelection (without a maybe).<BR/><BR/>What might be confusing is that in order to avoid duplicating code, the implementations of RadioView, ListView and ChoiceView all use viewGet/SetTypedMaybeSelection just But radioView removes the maybe type and gives an error in case of an empty selection (which will not occur).<BR/><BR/>Cheers,<BR/>MartijnAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-21123659.post-6458317441302312832008-03-20T20:52:00.000+01:002008-03-20T20:52:00.000+01:00I will email martijn about the issue. He properly ...I will email martijn about the issue. He properly have a good explanation of why he uses Maybe.Mads Lindstrømhttps://www.blogger.com/profile/07278646628198259546noreply@blogger.comtag:blogger.com,1999:blog-21123659.post-83173239445351173092008-03-20T20:43:00.000+01:002008-03-20T20:43:00.000+01:00With "typedValue :: Attr w x" we can still define ...With "typedValue :: Attr w x" we can still define x as "Maybe something" and I therefore see no reason to make two TypedValue type classes.<BR/><BR/>As a follow-up on my previous post I did a little experiment. I opened GEdit's (Gnome's default text editor) preferences dialog. Non of the widgets could be left in a "Nothing" state. Mainly because the widgets were mostly check boxes, which simply is either true or false - no "Nothing" state. There were also some integer widgets. I could delete all the numbers, but then it would just revert to some default value. Again I could not put the widget in a "Nothing" state.Mads Lindstrømhttps://www.blogger.com/profile/07278646628198259546noreply@blogger.comtag:blogger.com,1999:blog-21123659.post-63463185944032650822008-03-20T20:32:00.000+01:002008-03-20T20:32:00.000+01:00Oh, and one more thing. I think that TypedSelecti...Oh, and one more thing. I think that TypedSelection does not use Maybe...koweyhttps://www.blogger.com/profile/11175806459477851520noreply@blogger.comtag:blogger.com,1999:blog-21123659.post-38339090215589717372008-03-20T20:30:00.000+01:002008-03-20T20:30:00.000+01:00By the way, I think you may have also noticed that...By the way, I think you may have also noticed that they have some code they would like us to integrate into wxhaskell.koweyhttps://www.blogger.com/profile/11175806459477851520noreply@blogger.comtag:blogger.com,1999:blog-21123659.post-78378254779140192082008-03-20T20:29:00.000+01:002008-03-20T20:29:00.000+01:00That's a good question. I'm actually not working ...That's a good question. I'm actually not working on XTC, by the way, just packaging it up to make it (a little bit) nicer to use wxhaskell. So it may be worth asking Martijn.<BR/><BR/>One thought is that it would be useful for things like the textEntry widget. Maybe there ought to be two kinds of typed values?koweyhttps://www.blogger.com/profile/11175806459477851520noreply@blogger.comtag:blogger.com,1999:blog-21123659.post-18571193191138230552008-03-20T20:18:00.000+01:002008-03-20T20:18:00.000+01:00I looked at your source code and found that your c...I looked at your source code and found that your class TypedValued is defined as:<BR/><BR/>class TypedValued x w | w -> x where<BR/> typedValue :: Attr w (Maybe x)<BR/><BR/>Is it really a good idea to use Maybe here?<BR/><BR/>Sometimes widgets are initialized from creation time and cannot be un-initialized. E.g. radio-buttons are commonly used this way. In this case you would be forcing Maybe where it is not necessary.<BR/><BR/><BR/>Greetings,<BR/><BR/>Mads LindstrømMads Lindstrømhttps://www.blogger.com/profile/07278646628198259546noreply@blogger.com