Skip to content

Commit 2712ee8

Browse files
Apply suggestions from code review
Co-authored-by: David Thrane Christiansen <[email protected]>
1 parent 8162ec3 commit 2712ee8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

message-index/messages/GHC-83865/terms/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ of type `Int`; yet, on the definition of `two` it was called with
88
an argument of type `String`.
99

1010
If you ever need to know the type of something, you can ask for it in `ghci`
11-
and ask for it with `:type` (or its shorthand `:t`):
11+
with the command `:type` (or its shorthand `:t`):
1212

1313
```
1414
ghci> :t "x"

message-index/messages/GHC-83865/type-kind-mism/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ order: 1
55

66
Forgetting the type parameter to `Maybe` is the culprit, but it is only caught in the
77
context of the the arrow in the declaration of `isNothing`, which can be confusing.
8-
Recall that the arrow (`->`) in Haskell is a type constructor, it takes two types
8+
The arrow (`->`) in Haskell is a _type constructor_. It takes two types
99
of *kind* `Type`, and returns a fresh type, also of kind `Type`. That is, for `x -> y`
1010
to make any sense, GHC needs `x` and `y` to be types of kind `Type`, which is not
1111
the case in this example: `Maybe` by itself has kind `Type -> Type`.

message-index/site.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,13 @@ messageCtx :: Context String
196196
messageCtx = field "id" (pure . getId) <> indexlessUrlField "url"
197197

198198
data ExampleOrder = InGroup Integer | Last
199-
deriving (Eq, Ord, Show)
199+
deriving (Eq, Show)
200+
201+
instance Ord ExampleOrder where
202+
compare (InGroup i) (InGroup j) = compare i j
203+
compare (InGroup _) Last = LT
204+
compare Last (InGroup _) = GT
205+
compare Last Last = EQ
200206

201207
getExampleOrder :: Identifier -> Compiler ExampleOrder
202208
getExampleOrder ident = do

0 commit comments

Comments
 (0)