Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/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:  Re: Selecting a GUI toolkit (Daniel Carrera)
   2. Re:  Re: Selecting a GUI toolkit (Daniel Carrera)
   3. Re:  gcd (Daniel Carrera)
   4. Re:  gcd (Daniel Fischer)
   5. Re:  Re: Selecting a GUI toolkit (Peter Verswyvelen)
   6. Re:  gcd (Steve)
   7. Re:  gcd (Daniel Fischer)


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

Message: 1
Date: Fri, 01 May 2009 22:16:43 +0200
From: Daniel Carrera <[email protected]>
Subject: Re: [Haskell-beginners] Re: Selecting a GUI toolkit
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Peter Verswyvelen wrote:
> I thought wxWidgets was actually one of the only toolkits that actually 
> *used* the native GUI libraries???

It does, and while I'm no expert on the subject, my understanding is 
that wxWidgets does the best job at matching the native UI. So far it 
seems that the things wx doesn't get right are small. The most 
significant difference I've seen so far is capitalization, and I'm not 
sure that this is an issue with wxWidgets per se, because the other 
screen shots on the wxWidgets site have the correct capitalization.

Daniel.


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

Message: 2
Date: Fri, 01 May 2009 22:20:50 +0200
From: Daniel Carrera <[email protected]>
Subject: Re: [Haskell-beginners] Re: Selecting a GUI toolkit
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Heinrich Apfelmus wrote:
>> More importantly, I'm not sure that a different cross-platform
>> toolkit would do a better job.
> 
> True, that. It's just that this doesn't mean that wxWidgets does a very
> good job.

Well, "very good job" is a really fuzzy term. Based on the very limited 
set of screen shots that I have seen, I think WX does well enough for 
anyone but a pedant (and you disagree, I know).

Anyways, to bring back some context into the discussion. We were talking 
about whether WX is better than X11+Gtk on Mac. I am confident that it is.

Daniel.


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

Message: 3
Date: Fri, 01 May 2009 22:28:12 +0200
From: Daniel Carrera <[email protected]>
Subject: Re: [Haskell-beginners] gcd
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I'm just another Haskell beginner, but what Steve says makes sense. 
Perhaps something like this:

gcd a b | b == 0    = a
         | b < 0     = gcd (-b) a
         | otherwise = gcd b (a `rem` b)

Daniel.

Steve wrote:
> I had a look at the gcd definition in GHC 6.10.1
> ghc-6.10.1/libraries/base/GHC/Real.lhs
> 
> -- | @'gcd' x y@ is the greatest (positive) integer that divides both
> @x@
> -- and @y@; for example @'gcd' (-3) 6@ = @3@, @'gcd' (-3) (-6)@ = @3@,
> -- @'gcd' 0 4@ = @4...@.  @'gcd' 0 0@ raises a runtime error.
> gcd             :: (Integral a) => a -> a -> a
> gcd 0 0         =  error "Prelude.gcd: gcd 0 0 is undefined"
> gcd x y         =  gcd' (abs x) (abs y)
>                    where gcd' a 0  =  a
>                          gcd' a b  =  gcd' b (a `rem` b)
> 
> Why is gcd 0 0 undefined?
> 
> http://en.wikipedia.org/wiki/Greatest_common_divisor says:
> "It is useful to define gcd(0, 0) = 0 and lcm(0, 0) = 0 because then the
> natural numbers become a complete distributive lattice with gcd as meet
> and lcm as join operation. This extension of the definition is also
> compatible with the generalization for commutative rings given below."
> 
> An added advantage, for haskell, of defining gcd 0 0 = 0 is that gcd
> would change from being a partial function to a total function.
> 
> Regards,
> Steve
> 
> 
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
> 



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

Message: 4
Date: Fri, 1 May 2009 22:44:52 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] gcd
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="iso-8859-1"

Am Freitag 01 Mai 2009 22:28:12 schrieb Daniel Carrera:
> I'm just another Haskell beginner, but what Steve says makes sense.

Yes, it's something I've often been annoyed by.
It's a wart (rather an error) in the Haskell report 
http://haskell.org/onlinereport/basic.html#sect6.4.2
where it's specified that gcd 0 0 shall raise a runtime error. I hope that gets 
fixed in 
the next standard.

> Perhaps something like this:
>
> gcd a b | b == 0    = a
>
>          | b < 0     = gcd (-b) a
>          | otherwise = gcd b (a `rem` b)
>
> Daniel.

No, that would check for negative numbers in each iteration. Just remove the 
line

gcd 0 0         =  error "Prelude.gcd: gcd 0 0 is undefined"

and everything's fine.
>
> Steve wrote:
> > I had a look at the gcd definition in GHC 6.10.1
> > ghc-6.10.1/libraries/base/GHC/Real.lhs
> >
> > -- | @'gcd' x y@ is the greatest (positive) integer that divides both
> > @x@
> > -- and @y@; for example @'gcd' (-3) 6@ = @3@, @'gcd' (-3) (-6)@ = @3@,
> > -- @'gcd' 0 4@ = @4...@.  @'gcd' 0 0@ raises a runtime error.
> > gcd             :: (Integral a) => a -> a -> a
> > gcd 0 0         =  error "Prelude.gcd: gcd 0 0 is undefined"
> > gcd x y         =  gcd' (abs x) (abs y)
> >                    where gcd' a 0  =  a
> >                          gcd' a b  =  gcd' b (a `rem` b)
> >
> > Why is gcd 0 0 undefined?
> >
> > http://en.wikipedia.org/wiki/Greatest_common_divisor says:
> > "It is useful to define gcd(0, 0) = 0 and lcm(0, 0) = 0 because then the
> > natural numbers become a complete distributive lattice with gcd as meet
> > and lcm as join operation. This extension of the definition is also
> > compatible with the generalization for commutative rings given below."
> >
> > An added advantage, for haskell, of defining gcd 0 0 = 0 is that gcd
> > would change from being a partial function to a total function.
> >
> > Regards,
> > Steve



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

Message: 5
Date: Fri, 1 May 2009 22:46:39 +0200
From: Peter Verswyvelen <[email protected]>
Subject: Re: [Haskell-beginners] Re: Selecting a GUI toolkit
To: Thomas Davie <[email protected]>
Cc: Heinrich Apfelmus <[email protected]>,
        [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="windows-1252"

Well, cross-platform toolkits could work if they don't provide widgets as
first class objects :-) So never allow specifying the GUI widgets and layout
directly, only indirectly.
So you basically provide just the model and some hints/constraints and let
the GUI toolkit automatically generate native look&feel widgets to present
and edit the model. This means the GUI toolkit needs to understand and
implement the guidelines on each platform (how many GUI developers actually
follow these guidelines 100%?)

If you provide constraints that are conflicting between GUI platforms, you
have to either relax the constraints or provide different widgets for each
platform.

All nice theoretically, but not done yet?

On Fri, May 1, 2009 at 5:55 PM, Thomas Davie <[email protected]> wrote:

> This is one of many reasons why I don't believe any of these cross-platform
> toolkits will ever be good enough to make truly native-like UIs – The bottom
> line is that tab views are different between Mac OS and other OSes, they
> have much more padding round them on Mac OS.  This means that any layout you
> create involving them will never work on both platforms.
>
> Bob
>
>
> On 1 May 2009, at 17:25, Heinrich Apfelmus wrote:
>
>  Peter Verswyvelen wrote:
>>
>>> I thought wxWidgets was actually one of the only toolkits that actually
>>> *used* the native GUI libraries???
>>> See e.g. http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits
>>>
>>> So I don't understand how come the look and feel is different then...
>>>
>>
>> Using native GUI libraries is necessary, but not sufficient for
>> achieving the same look and feel. :)
>>
>> Other elements are layout and spacing,
>>
>>  http://developer.apple.decenturl.com/human-interface-guidelines-layout
>>  http://developer.apple.decenturl.com/hi-guidelines-windows
>>
>> drag & drop,
>>
>>  http://developer.apple.decenturl.com/hi-guidelines-dragndrop
>>
>> writing style and fonts
>>
>>  http://developer.apple.decenturl.com/human-interface-guidelines-text
>>
>> etc, etc.
>>
>>
>> Daniel Carrera wrote:
>>
>>> Thirdly, the textlogs have different fonts. Again, the wxHaskell one
>>>> looks non-standard.
>>>>
>>>>  Honestly, I can't tell. They are both very similar, sans fonts. Also,
>>> the
>>> font could  be explained by the fact that these screen shots are taken on
>>> different computers (different OS versions, different settings).
>>>
>>
>> There is a default set of fonts
>>
>>  http://developer.apple.decenturl.com/human-interface-guidelines-text
>>
>> The "mini system font" is the typography of choice for text boxes, but
>> it looks the "application font" is acceptable as well.
>>
>>  In any case, I think these differences are minor.
>>>
>>
>> I don't. :)
>>
>>  More importantly, I'm not sure that a different cross-platform
>>> toolkit would do a better job.
>>>
>>
>> True, that. It's just that this doesn't mean that wxWidgets does a very
>> good job.
>>
>>
>> Regards,
>> apfelmus
>>
>> --
>> http://apfelmus.nfshost.com
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20090501/9e66d037/attachment-0001.htm

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

Message: 6
Date: Sat, 02 May 2009 10:08:16 +0800
From: Steve <[email protected]>
Subject: Re: [Haskell-beginners] gcd
To: Peter Verswyvelen <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain

On Fri, 2009-05-01 at 16:19 +0200, Peter Verswyvelen wrote:
> I suggest you forward this to the Haskell Cafe, since it's not really
> a beginners question, it's a really good question :)

Thanks for the advice, I've reposted the question to the Haskell Cafe.
Steve

> On Fri, May 1, 2009 at 4:19 PM, Steve <[email protected]>
> wrote:
>         I had a look at the gcd definition in GHC 6.10.1
>         ghc-6.10.1/libraries/base/GHC/Real.lhs
>         
>         -- | @'gcd' x y@ is the greatest (positive) integer that
>         divides both
>         @x@
>         -- and @y@; for example @'gcd' (-3) 6@ = @3@, @'gcd' (-3)
>         (-6)@ = @3@,
>         -- @'gcd' 0 4@ = @4...@.  @'gcd' 0 0@ raises a runtime error.
>         gcd             :: (Integral a) => a -> a -> a
>         gcd 0 0         =  error "Prelude.gcd: gcd 0 0 is undefined"
>         gcd x y         =  gcd' (abs x) (abs y)
>                           where gcd' a 0  =  a
>                                 gcd' a b  =  gcd' b (a `rem` b)
>         
>         Why is gcd 0 0 undefined?
>         
>         http://en.wikipedia.org/wiki/Greatest_common_divisor says:
>         "It is useful to define gcd(0, 0) = 0 and lcm(0, 0) = 0
>         because then the
>         natural numbers become a complete distributive lattice with
>         gcd as meet
>         and lcm as join operation. This extension of the definition is
>         also
>         compatible with the generalization for commutative rings given
>         below."
>         
>         An added advantage, for haskell, of defining gcd 0 0 = 0 is
>         that gcd
>         would change from being a partial function to a total
>         function.
>         
>         Regards,
>         Steve
>         
>         
>         
>         _______________________________________________
>         Beginners mailing list
>         [email protected]
>         http://www.haskell.org/mailman/listinfo/beginners
> 
> 



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

Message: 7
Date: Sat, 2 May 2009 04:13:47 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] gcd
To: [email protected]
Cc: Steve <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="iso-8859-15"

Am Samstag 02 Mai 2009 04:08:16 schrieb Steve:
> On Fri, 2009-05-01 at 16:19 +0200, Peter Verswyvelen wrote:
> > I suggest you forward this to the Haskell Cafe, since it's not really
> > a beginners question, it's a really good question :)

I know that wasn't meant as it was written, but ouch.



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

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 11, Issue 2
****************************************

Reply via email to