You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hints/comparing-records.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ viewStudent student =
35
35
li [] [ text student.name ]
36
36
```
37
37
38
-
If you are worried about the performance of changing the order or updating information about particular students, you can start using the [`Html.Lazy`](https://package.gren-lang.org/packages/gren/html/latest/Html-Lazy) and [`Html.Keyed`](https://package.gren-lang.org/packages/gren/html/latest/Html-Keyed) modules. The updated code would look something like this:
38
+
If you are worried about the performance of changing the order or updating information about particular students, you can start using the [`Html.Lazy`](https://packages.gren-lang.org/package/gren-lang/browser/latest/module/Html.Lazy) and [`Html.Keyed`](https://packages.gren-lang.org/package/gren-lang/browser/latest/module/Html.Keyed) modules. The updated code would look something like this:
Copy file name to clipboardExpand all lines: hints/imports.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ When getting started with Gren, it is pretty common to have questions about how
8
8
9
9
An Gren file is called a **module**. To access code in other files, you need to `import` it!
10
10
11
-
So say you want to use the [`div`](http://package.gren-lang.org/packages/gren-lang/html/latest/Html#div) function from the [`gren-lang/html`](http://package.gren-lang.org/packages/gren-lang/html/latest) package. The simplest way is to import it like this:
11
+
So say you want to use the [`div`](https://packages.gren-lang.org/package/gren-lang/browser/latest/module/Html#div) function from the [`gren-lang/browser`](https://packages.gren-lang.org/package/gren-lang/browser/latest/overview) package. The simplest way is to import it like this:
12
12
13
13
```gren
14
14
import Html
@@ -20,7 +20,7 @@ main =
20
20
After saying `import Html` we can refer to anything inside that module as long as it is _qualified_. This works for:
21
21
22
22
-**Values**— we can refer to `Html.text`, `Html.h1`, etc.
23
-
-**Types**— We can refer to [`Attribute`](http://package.gren-lang.org/packages/gren-lang/html/latest/Html#Attribute) as `Html.Attribute`.
23
+
-**Types**— We can refer to [`Attribute`](https://packages.gren-lang.org/package/gren-lang/browser/latest/module/Html#Attribute) as `Html.Attribute`.
24
24
25
25
So if we add a type annotation to `main` it would look like this:
26
26
@@ -32,7 +32,7 @@ main =
32
32
Html.div [] []
33
33
```
34
34
35
-
We are referring to the [`Html`](http://package.gren-lang.org/packages/gren-lang/html/latest/Html#Html) type, using its _qualified_ name `Html.Html`. This can feel weird at first, but it starts feeling natural quite quickly!
35
+
We are referring to the [`Html`](https://packages.gren-lang.org/package/gren-lang/browser/latest/module/Html#Html) type, using its _qualified_ name `Html.Html`. This can feel weird at first, but it starts feeling natural quite quickly!
36
36
37
37
> **Note:** Modules do not contain other modules. So the `Html` module _does not_ contain the `Html.Attributes` module. Those are separate names that happen to have some overlap. So if you say `import Html` you _do not_ get access to `Html.Attributes.style`. You must `import Html.Attributes` module separately.
Saying `import Html.Attributes as A` lets us refer to any value or type in `Html.Attributes` as long as it is qualified with an `A`. So now we can refer to [`style`](http://package.gren-lang.org/packages/gren-lang/html/latest/Html-Attributes#style) as `A.style`.
53
+
Saying `import Html.Attributes as A` lets us refer to any value or type in `Html.Attributes` as long as it is qualified with an `A`. So now we can refer to [`style`](https://packages.gren-lang.org/package/gren-lang/browser/version/6.0.0/module/Html.Attributes#style) as `A.style`.
Copy file name to clipboardExpand all lines: hints/init.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# Creating an Gren project
1
+
# Creating a Gren project
2
2
3
3
The main goal of `gren init` is to get you to this page!
4
4
5
5
It just creates an `gren.json` file and a `src/` directory for your code.
6
6
7
7
## What is `gren.json`?
8
8
9
-
This file describes your project. It lists all of the packages you depend upon, so it will say the particular version of [`gren/core`](https://package.gren-lang.org/packages/gren/core/latest/) and [`gren/html`](https://package.gren-lang.org/packages/gren/html/latest/) that you are using. It makes builds reproducible! You can read a bit more about it [here](https://github.com/gren/compiler/blob/master/docs/gren.json/application.md).
9
+
This file describes your project. It lists all of the packages you depend upon, so it will say the particular version of [`gren-lang/core`](https://packages.gren-lang.org/package/gren-lang/core/latest/overview) and [`gren-lang/browser`](https://packages.gren-lang.org/package/gren-lang/browser/latest/overview) that you are using. It makes builds reproducible! You can read a bit more about it [here](https://gren-lang.org/book/appendix/gren_json/).
10
10
11
-
You should generally not edit it by hand. It is better to add new dependencies with commands like `gren install gren/http` or `gren install gren/json`.
11
+
You should generally not edit it by hand. It is better to add new dependencies with commands like `gren package install gren-lang/test` or `gren package install gren-lang/parser`.
Copy file name to clipboardExpand all lines: hints/missing-patterns.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ Now the compiler will say "hey, what should `toName` do when it sees a `Visitor`
49
49
50
50
Imagine that the `User` type appears in 20 or 30 functions across your project. When we add a `Visitor` variant, the compiler points out all the places that need to be updated. That is very convenient, but in a big project, maybe you want to get through it extra quickly.
51
51
52
-
In that case, it can be helpful to use [`Debug.todo`](https://package.gren-lang.org/packages/gren-lang/core/latest/Debug#todo) to leave some code incomplete:
52
+
In that case, it can be helpful to use [`Debug.todo`](https://packages.gren-lang.org/package/gren-lang/core/latest/module/Debug#todo) to leave some code incomplete:
0 commit comments