Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This pattern of defining typeclasses instances and then including the correspond

ReasonML/OCaml does not support implicit typeclass resolution like Haskell, Purescript, and Scala. This is a bummer, because it puts some roadblocks in the way of seamlessly using the typeclass infrastructure that is provided by `Relude`. For example, in `Haskell`, you can use the `>>=` (`bind`) operator anywhere you want, as long as the compiler can find a `Monad` instance for the type in question somewhere in scope. In ReasonML/OCaml, there is no ad-hoc polymorphism, so you can't just use operators and functions from typeclasses like you can in Haskell and Purescript.

Instead, ReasonML/OCaml provides the concept of [first-class modules](https://v1.realworldocaml.org/v1/en/html/first-class-modules.html). This allows you to pass actual OCaml modules into functions, which gives you the same power of abstraction as typeclasses, but without the implicit (automatic) resolution. "First-class modules" can be a bit brain-bending at first, but it becomes more clear when demonstrated with simpler typeclasses like `SHOW` or `EQ`.
Instead, ReasonML/OCaml provides the concept of [first-class modules](https://dev.realworldocaml.org/first-class-modules.html). This allows you to pass actual OCaml modules into functions, which gives you the same power of abstraction as typeclasses, but without the implicit (automatic) resolution. "First-class modules" can be a bit brain-bending at first, but it becomes more clear when demonstrated with simpler typeclasses like `SHOW` or `EQ`.

## `*By` functions as an alternative to first-class modules

Expand Down
2 changes: 1 addition & 1 deletion src/Relude.re
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ the [Array] module provided by the OCaml stdlib.
In many cases, however, you {e will} want to shadow the existing stdlib modules
with their Relude equivalents. In this case, you could [open Relude;] but doing
so may shadow more than you want (e.g. the [Js] module provided by Melange will
also be shadowed). See {{: Relude_Globals} [Relude.Globals]} for a better
also be shadowed). See {{: ./Relude_Globals} [Relude.Globals]} for a better
solution.
|}
];
Expand Down
Loading