[Haskell-cafe] Re: Converting IO [XmlTree] to [XmlTree]
wikigracenotes at gmail.com
Tue Apr 28 04:33:30 EDT 2009
On Mon, Apr 27, 2009 at 4:19 PM, Martijn van Steenbergen <
martijn at van.steenbergen.nl> wrote:
> They are in order of power: every monad is an applicative; every
> applicative is a functor; every functor is pointed.
> Though I can't think of any non-functor pointiness at the moment.
On the other hand, here's an un-pure-able and un-point-able functor:
instance Functor ((,) m) where
--fmap :: (n -> n') -> (m, n) -> (m, n')
fmap f (m, n) = (m, f n)
n -> (m, n) is not a function you can write in general without bottom values
(unless you specify that m is a monoid, using mempty). Nor is Pointed in the
f () sense, since forall a. (a, ()) isn't something for which a value can be
pulled out of thin non-bottom air. But... getting a bit off-topic >_>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe