flix / programming-flix

A tutorial for programming in Flix
Apache License 2.0
6 stars 13 forks source link

Refactor: documentation part 1 #61

Closed ninaandrup closed 2 years ago

ninaandrup commented 2 years ago

Related to #60

In this PR

There are still open issues for some of the pages. But everything not in those issues should be fixed in this PR.

magnus-madsen commented 2 years ago

Good work so far 👍

ninaandrup commented 2 years ago

I'm a bit unsure of this example:

def map(f: a -> b & e, l: List[a]): List[b] & e = ...

The code in the flix library is & ef instead of & e

magnus-madsen commented 2 years ago

We have decided to use ef (instead of e) by convention.

ninaandrup commented 2 years ago

Here Eq is not defines for the enum. Does it matter, since it is illustrating Using Enums from a Namespace ?

magnus-madsen commented 2 years ago

Here Eq is not defines for the enum. Does it matter, since it is illustrating Using Enums from a Namespace ?

You can sneak in a with Eq on the relevant enum.

ninaandrup commented 2 years ago

I think maybe this paragraph needs to be rewritten. I could not find any functions in the library using an argument f: a ~> Unit. Everything is changed to f: a -> Unit & ef, right?

ninaandrup commented 2 years ago

I think maybe this paragraph needs to be rewritten. I could not find any functions in the library using an argument f: a ~> Unit. Everything is changed to f: a -> Unit & ef, right?

Trying it out in VS code, I can see, that f: a ~> Unit won't compile. On the same page, there is already this paragraph about effect polymorphism. Maybe the other paragraph should just inform the user, that specifying an argument function as impure is not possible?

ninaandrup commented 2 years ago

I think maybe this paragraph needs to be rewritten. I could not find any functions in the library using an argument f: a ~> Unit. Everything is changed to f: a -> Unit & ef, right?

Trying it out in VS code, I can see, that f: a ~> Unit won't compile. On the same page, there is already this paragraph about effect polymorphism. Maybe the other paragraph should just inform the user, that specifying an argument function as impure is not possible?

Mentioned again here in the table.

ninaandrup commented 2 years ago

Should I open some new issues for the paragraphs needing to be rewritten and such?

magnus-madsen commented 2 years ago

Should I open some new issues for the paragraphs needing to be rewritten and such?

Yes. Lets keep this PR for simple things and then make a new issue for the things where new sentences are needed.

magnus-madsen commented 2 years ago

Can you open a new ticket for the fixpoint issue? Then I will ask Jonathan to take a look.

ninaandrup commented 2 years ago

Can you open a new ticket for the fixpoint issue? Then I will ask Jonathan to take a look.

Sure :) see #67

magnus-madsen commented 2 years ago