[Haskell-cafe] Pointed, but not Applicative

Maciej Marcin Piechotka uzytkownik2 at gmail.com
Mon Aug 29 05:24:54 CEST 2011


On Mon, 2011-08-29 at 12:00 +0900, Sebastian Fischer wrote:
> On Sun, Aug 28, 2011 at 12:41 AM, Sönke Hahn <shahn at cs.tu-berlin.de> wrote:
> > I was wondering which
> > type could be an instance of Pointed, but not of Applicative. But I can't
> > think of one. Any ideas?
> 
> Functional lists:
> 
>     type FList a = [a] -> [a]
> 
> they have a Monoid instance for empty and append, a "point" function
> for singletons but Applicative or Monad cannot be defined without
> converting back and forth to ordinary lists.
> 
> Sebastian

newtype FList a = FList ([a] -> [a])

instance Functor FList where
    f `fmap` FList g = ...?

The only possible implementation I can think of:

f `fmap` FList g = _|_
f `fmap` FList g = map id
f `fmap` FList g = map _|_
(+ variation of _|_*)

Neither of them holding fmap id = id.

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110829/4c34381d/attachment.pgp>


More information about the Haskell-Cafe mailing list