Functor => Pointed => Applicative => Monad
uzytkownik2 at gmail.com
Mon Nov 29 11:38:15 EST 2010
On Mon, 2010-11-29 at 15:30 +0000, Stephen Tetley wrote:
> On 29 November 2010 13:28, John Smith <voldermort at hotmail.com> wrote:
> > fmap = map
> > This could be part of a legacy module, along with any other eliminated
> > duplicated functions. Historical cruft remains in Haskell far too long; is
> > there no desire for an occasional cleanup?
> Speaking personally, I'm quite happy to have both map and (functorial) fmap.
> Haskell's intention is to be a "state of the art _functional_
> language", so keeping the functional core doesn't seem unwarranted to
> me. There is the Charity language which was "categorical" first, and
> "functional" second if people really want a "crystal mountain".
While duplicating methods is one side of problem the bigger problem is
when you try to write as general as possible and end up with:
func1 :: Pointed a => ...
func2 :: Applicative a => ...
func3 :: (Pointed a, Applicative a, Monad a) => ...
-- Uses func1 and func2 + require monad
map as (fmap :: (a -> b) -> [a] -> [b]) have it's uses even when Functor
=> Pointed => Applicative => Monad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/libraries/attachments/20101129/5bd5a9b2/attachment.bin
More information about the Libraries