在“松散的monoidal仿函数”中,“松散”是什么意思?

问题描述 投票:16回答:1

我知道Applicative类在类别理论中被描述为“松散的monoidal仿函数”,但我之前从未听过“lax”这个词,而the nlab page on lax functor是我根本不认识的一堆东西,re:bicategories and things我不知道我们在Haskell里关心过什么。如果它实际上是关于bicategories,有人可以给我一个plebian视图,这意味着什么?否则,这个名字的“松懈”是什么?

haskell applicative category-theory
1个回答
17
投票

让我们切换到Applicative的monoidal视图:

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))

对于严格的幺半群算子,unitmult必须是同构。 “松懈”的影响是放弃这个要求。

例如,(直到通常的天真)(->) a是严格的幺半群,但[]只是松散的幺半群。

© www.soinside.com 2019 - 2024. All rights reserved.