Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "lax" mean in "lax monoidal functor"?

I know that the Applicative class is described in category theory as a "lax monoidal functor" but I've never heard the term "lax" before, and the nlab page on lax functor a bunch of stuff I don't recognize at all, re: bicategories and things that I didn't know we cared about in Haskell. If it is actually about bicategories, can someone give me a plebian view of what that means? Otherwise, what is "lax" doing in this name?

like image 755
luqui Avatar asked Sep 07 '18 09:09

luqui


1 Answers

Let's switch to the monoidal view of Applicative:

unit ::     ()     -> f   ()
mult :: (f s, f t) -> f (s, t)

pure :: x -> f x
pure x = fmap (const x) (unit ())
(<*>) :: f (s -> t) -> f s -> f t
ff <*> fs = fmap (uncurry ($)) (mult (ff, fs))

For a strict monoidal functor, unit and mult must be isomorphisms. The impact of "lax" is to drop that requirement.

E.g., (up to the usual naivete) (->) a is strict-monoidal, but [] is only lax-monoidal.

like image 162
pigworker Avatar answered Nov 04 '22 16:11

pigworker