Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antonkalinin-ml
Copy link
Contributor

@antonkalinin-ml antonkalinin-ml commented Dec 21, 2021

Доработка вопросов после моей сдачи.

У меня еще кое-что записано, надо уточнить

  • было предложение добавить вопрос "в тайплевеле или в дата левеле хранятся метаданные?", но я забыл контекст. В какой раздел его ставить?
  • предложение спрашивать про Data.Data - а оно нужно? Вроде бы это устаревший, не лучший способ.
  • предложение добавить вопрос про дефолтинг рулез - забылся контекст. Если это про директиву default вне тайпклассов, то это новая тема, ее надо самим изучить.
  • предложение добавить вопрос про структурный полиморфизм - бегло погуглив, не вышло найти это понятие (применительно к программированию), в хаскель вики этого тоже нет.
  • если вдруг middle-1 недостаточно нагружен, могу добавить пейпер по Traversable и вопросы к нему. Это может помочь понимать Traversable лучше, его предназначение и возможности.
  • непонятен ответ на вопрос про rethrowing async as sync, удалить?

@antonkalinin-ml antonkalinin-ml force-pushed the middle1-haskell-add-questions branch 2 times, most recently from 419ea59 to b644409 Compare March 22, 2022 17:09
@olgaklimenko
Copy link
Contributor

Я на мидла еще не сдавала эту тему, лучше поставить на ревью Олега или Стаса

@antonkalinin-ml antonkalinin-ml changed the title middle-1/haskell: add more questions WIP: middle-1/haskell: add more questions Mar 24, 2022
@antonkalinin-ml antonkalinin-ml force-pushed the middle1-haskell-add-questions branch from b644409 to 5912347 Compare March 24, 2022 15:57
Comment on lines -3 to -42
## 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?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут ничего не изменилось, кроме заголовка и убирания одного уровня отступа под элементом Functors.

Comment on lines +33 to +55
* 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.
Copy link
Contributor Author

@antonkalinin-ml antonkalinin-ml Mar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я обещал добавить источник, где я видел это объяснение, но не смог его найти, так что пришлось написать прямо здесь. Ребятам на сдаче понравилось. После прочтения других источников оно не всегда появляется в голове.

@antonkalinin-ml antonkalinin-ml marked this pull request as ready for review March 24, 2022 16:12
@antonkalinin-ml antonkalinin-ml changed the title WIP: middle-1/haskell: add more questions middle-1/haskell: add more questions Mar 24, 2022
@antonkalinin-ml antonkalinin-ml force-pushed the middle1-haskell-add-questions branch from 8611844 to b0e7941 Compare September 9, 2022 06:03
@stanislav-az
Copy link
Contributor

было предложение добавить вопрос "в тайплевеле или в дата левеле хранятся метаданные?", но я забыл контекст. В какой раздел его ставить?

Это похоже про GHC.Generics.

предложение спрашивать про Data.Data - а оно нужно? Вроде бы это устаревший, не лучший способ.

Ну раз оно не используется, то да - не нужно тогда.

предложение добавить вопрос про дефолтинг рулез - забылся контекст. Если это про директиву default вне тайпклассов, то это новая тема, ее надо самим изучить.

По-моему это про дефолтинг типов при -XMonomorphismRestriction. К примеру Num a => a будет Integer. Не думаю, что стоит про это спрашивать.

предложение добавить вопрос про структурный полиморфизм - бегло погуглив, не вышло найти это понятие (применительно к программированию), в хаскель вики этого тоже нет.

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"
https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.55.4995 "structural polymorphism, a new form of type polymorphism appropriate to functional languages featuring user-defined algebraic data types (e.g., Standard ML, Haskell and Miranda 1 ). The approach extends the familiar notion of parametric polymorphism by allowing the definition of functions which are generic with respect to data structures as well as to individual types. "
Похоже structural polymorphism = generic programming.

если вдруг middle-1 недостаточно нагружен, могу добавить пейпер по Traversable и вопросы к нему. Это может помочь понимать Traversable лучше, его предназначение и возможности.

Я не читал этот пейпер, не смогу сказать насколько полезно.

непонятен ответ на вопрос про rethrowing async as sync, удалить?

Здесь не очень понял, в чем проблема?

@@ -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`?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a Traverse -> a Traversal

Comment on lines +275 to +276
* When and why is it better to use `generic-lens` and `optics` libraries? What
libraries can we use together?
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants