wren ng thornton wren at freegeek.org
Thu Sep 16 00:45:37 EDT 2010

```On 9/13/10 6:23 PM, Paolo G. Giarrusso wrote:
> Then, I would also like to understand what exactly a strict functor
> is, in detail, and/or a link to the post you reference.

I'm assuming the OP was referring to a functor for strictness I
mentioned recently in the discussion about pointed functors. That is,

newtype Strict a = Strict a

instance Functor Strict where
-- This isn't a lawful endofunctor
fmap f (Strict a) = Strict (f \$! a)

instance Pointed Strict where
-- This isn't lawful either, as an endofunctor
point = Strict

The idea being that we make all applications strict. However, that
definition of fmap isn't lawful because we don't have that fmap(f . g) =
(fmap f).(fmap g) for all f and g. In particular, it fails when (f . g)
is bottom eating, i.e. when (g x == _|_) =/=> (f (g x) == _|_).

We can, however, define strict composition:

(f .! g) x = f \$! g x

And we do have that fmap(f .! g) = (fmap f).(fmap g) for Strict. So,
Strict is a (category theoretic) functor, it's just not an endofunctor

Given that any functor for adding strictness will have to deal with the
same issue of preserving bottom-eating compositions, I postulated that
a subcategory of Hask, it's trivial to go the other direction. In fact,
the Strict defined above can be considered as the inclusion functor from