-
Notifications
You must be signed in to change notification settings - Fork 264
middle-1/haskell: add more questions #343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут ничего не изменилось, кроме заголовка и убирания одного уровня отступа под элементом 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я обещал добавить источник, где я видел это объяснение, но не смог его найти, так что пришлось написать прямо здесь. Ребятам на сдаче понравилось. После прочтения других источников оно не всегда появляется в голове.
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"
Я не читал этот пейпер, не смогу сказать насколько полезно.
Здесь не очень понял, в чем проблема? |
@@ -235,13 +262,18 @@ What are the commands which help with that? | |||
* What is a `Traversal`? | |||
* What is an `Iso`? | |||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мне кажется нужно отдельно сделать этот вопрос:
What libraries can we use together (lens
, generic-lens
, microlens
, optics
) ?
Доработка вопросов после моей сдачи.
У меня еще кое-что записано, надо уточнить
Data.Data
- а оно нужно? Вроде бы это устаревший, не лучший способ.default
вне тайпклассов, то это новая тема, ее надо самим изучить.