Conversation
419ea59 to
b644409
Compare
|
Я на мидла еще не сдавала эту тему, лучше поставить на ревью Олега или Стаса |
b644409 to
5912347
Compare
| ## Basic type classes | ||
|
|
||
| * Functors | ||
| * What is covariance and contravariance in the context of functors and category theory? | ||
| * What are the negative and positive positions? | ||
| * What types can be both covariant functors and contravariant? | ||
| * What are invariant functors? | ||
| * Contrafunctor (Contravariant functor) | ||
| * What is the signature of `contramap` function? | ||
| * Make an example of instance definition for some ADT. | ||
| * What is the semantic meaning of applying `contramap`? | ||
| * Bifunctor | ||
| * What is the signature of `bimap` function? | ||
| * What ADT's do have the `Bifunctor` instance? | ||
| * Is a bifunctor covariant or contravariant on type variables applied to it? | ||
| * Profunctor | ||
| * What is the signature of `dimap` function? | ||
| * Write an instance implementation for `(->)`. | ||
| * Name a few practical use cases (at least one). | ||
| * Which of type variables applied to a profunctor appear in negative and which in positive position? |
There was a problem hiding this comment.
Тут ничего не изменилось, кроме заголовка и убирания одного уровня отступа под элементом Functors.
| * An easy explanation of `Contravariant`: a `Functor` may be thought as it | ||
| "contains" or "produces" values, while a `Contravariant` "consumes" them. Pay | ||
| attention on the polarity term. |
There was a problem hiding this comment.
Я обещал добавить источник, где я видел это объяснение, но не смог его найти, так что пришлось написать прямо здесь. Ребятам на сдаче понравилось. После прочтения других источников оно не всегда появляется в голове.
8611844 to
b0e7941
Compare
Это похоже про
Ну раз оно не используется, то да - не нужно тогда.
По-моему это про дефолтинг типов при
https://andres-loeh.de/Koke2005.pdf "Structural polymorphism (also called generic programming) makes the structure of datatypes available for the definition of type-indexed functions"
Я не читал этот пейпер, не смогу сказать насколько полезно.
Здесь не очень понял, в чем проблема? |
| * Why is `Monoid` constraint required in `view` for traversals? | ||
| * Is a `Prism` a `Lens`, a `Traversal` a `Lens`, an `Iso` a `Lens`, a | ||
| `Traversal` an `Iso`, a `Prism` an `Iso`, or vice versa? | ||
| * Is the `traverse` method of the `Traversable` class a `Traverse`? |
There was a problem hiding this comment.
a Traverse -> a Traversal
| * When and why is it better to use `generic-lens` and `optics` libraries? What | ||
| libraries can we use together? |
There was a problem hiding this comment.
Мне кажется нужно отдельно сделать этот вопрос:
What libraries can we use together (lens, generic-lens, microlens, optics) ?
Доработка вопросов после моей сдачи.
У меня еще кое-что записано, надо уточнить
Data.Data- а оно нужно? Вроде бы это устаревший, не лучший способ.defaultвне тайпклассов, то это новая тема, ее надо самим изучить.