haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] The container problem

Subject: Re: [Haskell-cafe] The container problem
From: "David Menendez"
Date: Fri, 26 Sep 2008 18:12:04 -0400
On Fri, Sep 26, 2008 at 5:37 PM, Andrew Coppin
<andrewcoppin@xxxxxxxxxxxxxx> wrote:
>
> As already noted, Data.Set *should* be a Monad, but can't be. The type
> system won't allow it. (And I know I'm not the first person to notice
> this...)

I wouldn't say that. It's important to remember that Haskell class
Monad does not, and can not, represent *all* monads, only (strong)
monads built on a functor from the category of Haskell types and
functions to itself.

Data.Set is a functor from the category of Haskell types *with
decidable ordering* and *order-preserving* functions to itself. That's
not the same category, although it is closely related.

-- 
Dave Menendez <dave@xxxxxxxxxxxx>
<http://www.eyrie.org/~zednenem/>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>