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: List Function (Clint Moore)
2. Re: Simplifying a 'split' function (Ertugrul Soeylemez)
3. Re: Selecting a GUI toolkit (Heinrich Apfelmus)
4. Re: Re: Selecting a GUI toolkit (Daniel Carrera)
5. Re: Re: Selecting a GUI toolkit (Peter Verswyvelen)
6. gcd (Steve)
7. Re: Selecting a GUI toolkit (Heinrich Apfelmus)
8. Re: Re: Selecting a GUI toolkit (Thomas Davie)
----------------------------------------------------------------------
Message: 1
Date: Thu, 30 Apr 2009 10:55:40 -0700
From: Clint Moore <[email protected]>
Subject: Re: [Haskell-beginners] Re: List Function
To: Heinrich Apfelmus <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes
> (Also, concerning terminology, sequence evaluates each monadic
> action.
> You can't evaluate a monad, it's a type constructor, not a function or
> value.)
Ah ha! I'm sure that it has been pointed out in some of the books
that I have read, but for some reason reading that made all of the
pieces suddenly fit together. Thanks for that!
------------------------------
Message: 2
Date: Thu, 30 Apr 2009 22:11:52 +0200
From: Ertugrul Soeylemez <[email protected]>
Subject: [Haskell-beginners] Re: Simplifying a 'split' function
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII
"Brandon S. Allbery KF8NH" <[email protected]> wrote:
> >> How about map pure. I do like the robot monkey though :)
> >
> > What is 'map pure'?
>
> It uses the applicative functor (Control.Applicative) instance for
> lists, just as "fmap return" uses the monad instance. Both work out
> to the same thing.
In fact, I'd choose a combination of both,
split = fmap pure
which seems to be most elegant to me. It's more general than both of
them. I just took 'return' instead of 'pure', because you don't need
any extra modules for that.
Greets,
Ertugrul.
--
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://blog.ertes.de/
------------------------------
Message: 3
Date: Fri, 01 May 2009 10:07:37 +0200
From: Heinrich Apfelmus <[email protected]>
Subject: [Haskell-beginners] Re: Selecting a GUI toolkit
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
Daniel Carrera wrote:
> Thomas Davie wrote:
>>> http://wxhaskell.sourceforge.net/images/controls-macosx2.png
>>
>> My link was on leopard actually, but that still looks significantly
>> different to the natively designed UI.
>
> Significantly different? They are practically identical.
IMHO, they are quite different, and it shows. :)
The first difference is the spacing. In the wxHaskell version, the
enclosing tab is glued to the window border left and right, while there
is a considerable margin in the native version. The inner boxes have
spacious margins, too.
The second is the capitalization in the native version. That gives it a
totally different look! I even thought that they were using different
fonts at first.
Thirdly, the textlogs have different fonts. Again, the wxHaskell one
looks non-standard.
Overall, I think it's quite visible that the wxHaskell version is not
native. What I don't understand is why, though; after all, most of the
above is specified in Apple's Human Interface Guidelines, it's just a
matter of implementing them.
Regards,
apfelmus
--
http://apfelmus.nfshost.com
------------------------------
Message: 4
Date: Fri, 01 May 2009 11:26:44 +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=windows-1252; format=flowed
Heinrich Apfelmus wrote:
> The first difference is the spacing. In the wxHaskell version, the
> enclosing tab is glued to the window border left and right, while there
> is a considerable margin in the native version. The inner boxes have
> spacious margins, too.
>
> The second is the capitalization in the native version. That gives it a
> totally different look! I even thought that they were using different
> fonts at first.
I didn't notice any of these except for the tab margin until you pointed
it out. The tab margin left and right is the only thing I noticed.
Taking a second look, I also notice the margin *below* the tab box.
> 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).
I just went to the wxWidgets website. On that site, the Mac OS screen
shots show the buttons capitalized. In any case, I think these
differences are minor. More importantly, I'm not sure that a different
cross-platform toolkit would do a better job.
Daniel.
------------------------------
Message: 5
Date: Fri, 1 May 2009 16:08:07 +0200
From: Peter Verswyvelen <[email protected]>
Subject: Re: [Haskell-beginners] Re: Selecting a GUI toolkit
To: Daniel Carrera <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
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...
On Fri, May 1, 2009 at 11:26 AM, Daniel Carrera <
[email protected]> wrote:
> Heinrich Apfelmus wrote:
>
>> The first difference is the spacing. In the wxHaskell version, the
>> enclosing tab is glued to the window border left and right, while there
>> is a considerable margin in the native version. The inner boxes have
>> spacious margins, too.
>>
>> The second is the capitalization in the native version. That gives it a
>> totally different look! I even thought that they were using different
>> fonts at first.
>>
>
> I didn't notice any of these except for the tab margin until you pointed
> it out. The tab margin left and right is the only thing I noticed.
> Taking a second look, I also notice the margin *below* the tab box.
>
>
> 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).
>
> I just went to the wxWidgets website. On that site, the Mac OS screen
> shots show the buttons capitalized. In any case, I think these differences
> are minor. More importantly, I'm not sure that a different cross-platform
> toolkit would do a better job.
>
> Daniel.
>
> _______________________________________________
> 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/defc7f19/attachment-0001.htm
------------------------------
Message: 6
Date: Fri, 01 May 2009 22:19:35 +0800
From: Steve <[email protected]>
Subject: [Haskell-beginners] gcd
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain
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: 7
Date: Fri, 01 May 2009 17:25:53 +0200
From: Heinrich Apfelmus <[email protected]>
Subject: [Haskell-beginners] Re: Selecting a GUI toolkit
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
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
------------------------------
Message: 8
Date: Fri, 1 May 2009 17:55:02 +0200
From: Thomas Davie <[email protected]>
Subject: Re: [Haskell-beginners] Re: Selecting a GUI toolkit
To: Heinrich Apfelmus <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=WINDOWS-1252; format=flowed;
delsp=yes
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
End of Beginners Digest, Vol 11, Issue 1
****************************************