Skip to content

Commit 75bfb52

Browse files
committed
Fix broken links and some cases of an Gren => a Gren.
1 parent ca3a4e4 commit 75bfb52

File tree

9 files changed

+23
-106
lines changed

9 files changed

+23
-106
lines changed

builder/src/Reporting/Exit.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ diffToReport diff =
133133
[ D.indent 4 $ D.red $ D.fromChars $ Pkg.toChars pkg,
134134
"Maybe you want one of these instead?",
135135
D.indent 4 $ D.dullyellow $ D.vcat $ map (D.fromChars . Pkg.toChars) suggestions,
136-
"But check <https://package.gren-lang.org> to see all possibilities!"
136+
"But check <https://packages.gren-lang.org> to see all possibilities!"
137137
]
138138
DiffUnknownVersion _pkg vsn realVersions ->
139139
Help.docReport
@@ -226,7 +226,7 @@ bumpToReport bump =
226226
"that",
227227
"version",
228228
"on",
229-
"<https://package.gren-lang.org>.",
229+
"<https://packages.gren-lang.org>.",
230230
"That",
231231
"means",
232232
"there",
@@ -2107,7 +2107,7 @@ makeToReport make =
21072107
D.indent 2 $ D.fillSep [D.cyan "Html" <> ".text", D.dullyellow "\"Hello!\""]
21082108
],
21092109
D.reflow $
2110-
"Or use https://package.gren-lang.org/packages/gren/core/latest/Platform#worker to\
2110+
"Or use https://packages.gren-lang.org/package/gren-lang/core/latest/module/Platform#worker to\
21112111
\ make a `main` with no user interface."
21122112
]
21132113
_ : _ ->
@@ -2134,7 +2134,7 @@ makeToReport make =
21342134
D.indent 2 $ D.fillSep [D.cyan "Html" <> ".text", D.dullyellow "\"Hello!\""]
21352135
],
21362136
D.reflow $
2137-
"Or use https://package.gren-lang.org/packages/gren/core/latest/Platform#worker to\
2137+
"Or use https://packages.gren-lang.org/package/gren-lang/core/latest/module/Platform#worker to\
21382138
\ make a `main` with no user interface."
21392139
]
21402140
MakeCannotBuild buildProblem ->

compiler/src/Reporting/Error/Canonicalize.hs

Lines changed: 2 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,10 @@ toReport source err =
502502
D.stack
503503
[ D.reflow $
504504
"If you want the behavior of (%) like in JavaScript, switch to:\
505-
\ <https://package.gren-lang.org/packages/gren/core/latest/Basics#remainderBy>",
505+
\ <https://packages.gren-lang.org/package/gren-lang/core/latest/module/Math#remainderBy>",
506506
D.reflow $
507507
"If you want modular arithmetic like in math, switch to:\
508-
\ <https://package.gren-lang.org/packages/gren/core/latest/Basics#modBy>",
508+
\ <https://packages.gren-lang.org/package/gren-lang/core/latest/module/Math#modBy>",
509509
D.reflow $
510510
"The difference is how things work when negative numbers are involved."
511511
]
@@ -1097,85 +1097,6 @@ toQualString :: Name.Name -> Name.Name -> String
10971097
toQualString prefix name =
10981098
Name.toChars prefix ++ "." ++ Name.toChars name
10991099

1100-
{-- VAR ERROR
1101-
1102-
varErrorToReport :: VarError -> Report.Report
1103-
varErrorToReport (VarError kind name problem suggestions) =
1104-
let
1105-
learnMore orMaybe =
1106-
D.reflow $
1107-
orMaybe <> " `import` works different than you expect? Learn all about it here: "
1108-
<> D.hintLink "imports"
1109-
1110-
namingError overview maybeStarter specializedSuggestions =
1111-
Report.reportDoc "NAMING ERROR" Nothing overview $
1112-
case D.maybeYouWant' maybeStarter specializedSuggestions of
1113-
Nothing ->
1114-
learnMore "Maybe"
1115-
Just doc ->
1116-
D.stack [ doc, learnMore "Or maybe" ]
1117-
1118-
specialNamingError specialHint =
1119-
Report.reportDoc "NAMING ERROR" Nothing (cannotFind kind name) (D.hsep specialHint)
1120-
in
1121-
case problem of
1122-
Ambiguous ->
1123-
namingError (ambiguous kind name) Nothing suggestions
1124-
1125-
UnknownQualifier qualifier localName ->
1126-
namingError
1127-
(cannotFind kind name)
1128-
(Just $ text $ "No module called `" <> qualifier <> "` has been imported.")
1129-
(map (\modul -> modul <> "." <> localName) suggestions)
1130-
1131-
QualifiedUnknown qualifier localName ->
1132-
namingError
1133-
(cannotFind kind name)
1134-
(Just $ text $ "`" <> qualifier <> "` does not expose `" <> localName <> "`.")
1135-
(map (\v -> qualifier <> "." <> v) suggestions)
1136-
1137-
ExposedUnknown ->
1138-
case name of
1139-
"!=" -> specialNamingError (notEqualsHint name)
1140-
"!==" -> specialNamingError (notEqualsHint name)
1141-
"===" -> specialNamingError equalsHint
1142-
"%" -> specialNamingError modHint
1143-
_ -> namingError (cannotFind kind name) Nothing suggestions
1144-
1145-
cannotFind :: VarKind -> Text -> [Doc]
1146-
cannotFind kind rawName =
1147-
let ( a, thing, name ) = toKindInfo kind rawName in
1148-
[ "Cannot", "find", a, thing, "named", D.dullyellow name <> ":" ]
1149-
1150-
ambiguous :: VarKind -> Text -> [Doc]
1151-
ambiguous kind rawName =
1152-
let ( _a, thing, name ) = toKindInfo kind rawName in
1153-
[ "This", "usage", "of", "the", D.dullyellow name, thing, "is", "ambiguous." ]
1154-
1155-
notEqualsHint :: Text -> [Doc]
1156-
notEqualsHint op =
1157-
[ "Looking", "for", "the", "“not", "equal”", "operator?", "The", "traditional"
1158-
, D.dullyellow $ text $ "(" <> op <> ")"
1159-
, "is", "replaced", "by", D.green "(/=)", "in", "Gren.", "It", "is", "meant"
1160-
, "to", "look", "like", "the", "“not", "equal”", "sign", "from", "math!", "(≠)"
1161-
]
1162-
1163-
equalsHint :: [Doc]
1164-
equalsHint =
1165-
[ "A", "special", D.dullyellow "(===)", "operator", "is", "not", "needed"
1166-
, "in", "Gren.", "We", "use", D.green "(==)", "for", "everything!"
1167-
]
1168-
1169-
modHint :: [Doc]
1170-
modHint =
1171-
[ "Rather", "than", "a", D.dullyellow "(%)", "operator,"
1172-
, "Gren", "has", "a", D.green "modBy", "function."
1173-
, "Learn", "more", "here:"
1174-
, "<https://package.gren-lang.org/packages/gren/core/latest/Basics#modBy>"
1175-
]
1176-
1177-
-}
1178-
11791100
-- ARG MISMATCH
11801101

11811102
_argMismatchReport :: Code.Source -> A.Region -> String -> Name.Name -> Int -> Int -> Report.Report

compiler/src/Reporting/Error/Docs.hs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ toReports source err =
5555
source
5656
region
5757
Nothing
58-
( D.reflow $
58+
( D.reflow
5959
"You must have a documentation comment between the module\
6060
\ declaration and the imports.",
61-
D.reflow
62-
"Learn more at <https://package.gren-lang.org/help/documentation-format>"
61+
D.empty
6362
)
6463
ImplicitExposing region ->
6564
NE.singleton $
@@ -97,11 +96,8 @@ toSyntaxProblemReport source problem =
9796
region
9897
Nothing
9998
( D.reflow "I was partway through parsing your module documentation, but I got stuck here:",
100-
D.stack $
101-
[ D.reflow details,
102-
D.toSimpleHint $
103-
"Read through <https://package.gren-lang.org/help/documentation-format> for\
104-
\ tips on how to write module documentation!"
99+
D.stack
100+
[ D.reflow details
105101
]
106102
)
107103
in case problem of

compiler/src/Reporting/Error/Syntax.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ noteForPortsInPackage =
634634
D.stack
635635
[ D.toSimpleNote $
636636
"One of the major goals of the package ecosystem is to be completely written\
637-
\ in Gren. This means when you install an Gren package, you can be sure you are safe\
637+
\ in Gren. This means when you install a Gren package, you can be sure you are safe\
638638
\ from security issues on install and that you are not going to get any runtime\
639639
\ exceptions coming from your new dependency. This design also sets the ecosystem\
640640
\ up to target other platforms more easily (like mobile phones, WebAssembly, etc.)\
@@ -792,7 +792,7 @@ toParseErrorReport source modul =
792792
"I got stuck here:",
793793
D.stack
794794
[ D.reflow $
795-
"I am not sure what is going on, but I recommend starting an Gren\
795+
"I am not sure what is going on, but I recommend starting a Gren\
796796
\ file with the following lines:",
797797
D.indent 4 $
798798
D.vcat $
@@ -803,7 +803,7 @@ toParseErrorReport source modul =
803803
],
804804
D.reflow $
805805
"You should be able to copy those lines directly into your file. Check out the\
806-
\ examples at <https://gren-lang.org/examples> for more help getting started!",
806+
\ examples at <https://github.com/gren-lang/example-projects> for more help getting started!",
807807
D.toSimpleNote $
808808
"This can also happen when something is indented too much!"
809809
]

hints/comparing-records.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ viewStudent student =
3535
li [] [ text student.name ]
3636
```
3737

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:
3939

4040
```gren
4141
import Html exposing (..)

hints/imports.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ When getting started with Gren, it is pretty common to have questions about how
88

99
An Gren file is called a **module**. To access code in other files, you need to `import` it!
1010

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:
1212

1313
```gren
1414
import Html
@@ -20,7 +20,7 @@ main =
2020
After saying `import Html` we can refer to anything inside that module as long as it is _qualified_. This works for:
2121

2222
- **Values** &mdash; we can refer to `Html.text`, `Html.h1`, etc.
23-
- **Types** &mdash; We can refer to [`Attribute`](http://package.gren-lang.org/packages/gren-lang/html/latest/Html#Attribute) as `Html.Attribute`.
23+
- **Types** &mdash; We can refer to [`Attribute`](https://packages.gren-lang.org/package/gren-lang/browser/latest/module/Html#Attribute) as `Html.Attribute`.
2424

2525
So if we add a type annotation to `main` it would look like this:
2626

@@ -32,7 +32,7 @@ main =
3232
Html.div [] []
3333
```
3434

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!
3636

3737
> **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.
3838
@@ -50,7 +50,7 @@ main =
5050
Html.div [ A.style "color" "red" ] [ Html.text "Hello!" ]
5151
```
5252

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`](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`.
5454

5555
<br>
5656

hints/init.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Creating an Gren project
1+
# Creating a Gren project
22

33
The main goal of `gren init` is to get you to this page!
44

55
It just creates an `gren.json` file and a `src/` directory for your code.
66

77
## What is `gren.json`?
88

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/).
1010

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`.
1212

1313
## What goes in `src/`?
1414

hints/missing-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Now the compiler will say "hey, what should `toName` do when it sees a `Visitor`
4949

5050
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.
5151

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:
5353

5454
```gren
5555
type User

src/Terminal/Parser.gren

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ parser =
230230
, PP.empty
231231
, PP.words
232232
"""
233-
This tries to compile an Gren file named src/Main.gren, generating an index.html
233+
This tries to compile a Gren file named src/Main.gren, generating an index.html
234234
file if possible.
235235
"""
236236
]

0 commit comments

Comments
 (0)