Skip to content
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

answer #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

answer #30

wants to merge 2 commits into from

Conversation

ludwig-vaan
Copy link

Hi,

If you want, you can create a new branch call answer, and use my commit for it.
btw, thanks for your work, it's appreciable to learn ReasonML.

@jasim
Copy link
Contributor

jasim commented Feb 2, 2019

@ludwig-vaan This is great, thanks! It might be nicer to have all the answers in the master branch itself. Let me think about it and merge it in a few days.

let greatest = ref(min_int);
let smallest = ref(max_int);
lst
|> List.iter(value => {

Choose a reason for hiding this comment

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

In my very personal opinion, an example answer probably shouldn't use |> given this syntax was not introduced in this tutorial.

Choose a reason for hiding this comment

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

I second that... Pipes are missing as a topic in this exercise. Plus its a very important concept.

Copy link
Contributor

Choose a reason for hiding this comment

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

@adilmas13 @PraveenInvideo Thanks, that makes sense. We're working on a major improvement to the content and will definitely fix this issue in that.

/* Write functions to extract the first and second elements from a pair. */
/* let first: pair('a) => 'a */
/* TODO try with fst */
let first = pair => fst(pair);

Choose a reason for hiding this comment

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

Where did fst and snd come from? Was the discovery of these functions the purpose of this exercise?

@jasim
Copy link
Contributor

jasim commented Jun 12, 2020

We're leaving this PR open for folks who want to see the answers. Many thanks to @ludwig-vaan.

We're working on a new iteration of the course. It'll have online interactive exercises with tests, more focus on types and not just FP/recursion, plus topics on real-world development with modules and interfaces.

We'll include the answers as hints/solutions in that version.

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.

4 participants