
On Mon, 2011-08-29 at 12:00 +0900, Sebastian Fischer wrote:
On Sun, Aug 28, 2011 at 12:41 AM, Sönke Hahn
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