Войти в систему

Home
    - Создать дневник
    - Написать в дневник
       - Подробный режим

LJ.Rossia.org
    - Новости сайта
    - Общие настройки
    - Sitemap
    - Оплата
    - ljr-fif

Редактировать...
    - Настройки
    - Список друзей
    - Дневник
    - Картинки
    - Пароль
    - Вид дневника

Сообщества

Настроить S2

Помощь
    - Забыли пароль?
    - FAQ
    - Тех. поддержка



Пишет Journal de Chaource ([info]lj_chaource)
@ 2018-05-29 03:01:00


Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Applicative profunctors
Just realized that non-functor profunctors can be applicative in a natural way. For example, `f` defined as

f a = (a, (a, a) -> a)

is a type constructor that is neither a functor nor a contrafunctor, but it looks like there is a lawful instance of applicative for f.

The `pure` is defined by

pure x = (x, _ -> x)

The monoidal product method is defined by

product :: (f a, f b) -> f (a, b)
product ((xa, qa), (xb, qb)) = ((xa, xb), \((a1, b1), (a2, b2)) -> (qa (a1, a2), qb (b1, b2))

Previously I have seen that a nonconstant contrafunctor cannot have a method of type f (a, b) -> (f a, f b). So, it is not to be expected that a profunctor would have such a method either.


(Читать комментарии) (Добавить комментарий)