Skip to content

Commit

Permalink
Fix a few typos
Browse files Browse the repository at this point in the history
  • Loading branch information
andywhite37 committed Aug 27, 2019
1 parent 0ab6d02 commit 8f44572
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/Conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This pattern of defining typeclasses instances and then including the correspond

## First-class modules

ReasonML/OCaml does not support implement typeclass isntance 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.
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`.

Expand Down
10 changes: 5 additions & 5 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
There are some issues open for exploring the possibility of compiling on the native OCaml
environment.

- [bs-abstract native compilation issue](https://github.com/Risto-Stevcev/bs-abstract/issues/13)
- [Relude native compilation issue](https://github.com/reazen/relude/issues/133)
- [bs-abstract native compilation issue](https://github.com/Risto-Stevcev/bs-abstract/issues/13)
- [Relude native compilation issue](https://github.com/reazen/relude/issues/133)

## Why does `Relude` use peer dependencies for everything, rather than hard production dependencies?

Expand All @@ -32,10 +32,10 @@ If you are trying to compile and get an error like:
This has type array(t) but somewhere wanted BsAbstract.Array.Foldable.t(string)`
```

you likely need to add `bs-abstract` to your `bs-dependencies` in your `bsconfig.json` file. This error occurs because BuckleScript is not able to find the types defined in the `BsAbstract` module, so it can't determine that `array(t)` is the same type as `BsAbstract.Array.Foldabe.t(string)`.
you likely need to add `bs-abstract` to your `bs-dependencies` in your `bsconfig.json` file. This error occurs because BuckleScript is not able to find the types defined in the `BsAbstract` module, so it can't determine that `array(t)` is the same type as `BsAbstract.Array.Foldable.t(string)`.

Since we are not using .rei interface files, we are not able to abstract these types away for functions that get included into our implementation modules. (See .rei topic below).
Because we are not using .rei interface files, we are not able to abstract these types away for functions that get included into our implementation modules. (See .rei topic below).

## Why doesn't `Relude` have interface (.rei) files?

`Relude` relies heavily on the module [include](https://reasonml.github.io/docs/en/module#extending-modules) capability of ReasonML/OCaml. Many of the typeclasses in `Relude` have extension modules that can be `include`d into your module to add a variety of useful utility functions, operators, and extension modules to your host module "for free," simply because you've taken the time to create an instance of a given typeclass. Since there are lots of functions automatically added to many modules, it becomes difficult to maintain good .rei files which include documentation and more specialized type annotations. Until we have a maintainable solution to this challenge, we are avoiding the use of .rei files.
e`Relude` relies heavily on the module [include](https://reasonml.github.io/docs/en/module#extending-modules) capability of ReasonML/OCaml. Many of the typeclasses in `Relude` have extension modules that can be `include`'d into your module to add a variety of useful utility functions, operators, and extension modules to your host module "for free," simply because you've taken the time to create an instance of a given typeclass. Because there are lots of functions automatically added to many modules, it becomes difficult to maintain good .rei files which expose all of these automatically added functions, while at the same time including documentation and more specialized type annotations. Until we have a maintainable solution for this challenge, we are avoiding the use of .rei files.
3 changes: 3 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
autoHeader: true,
subMaxLevel: 2,

// Auto scroll
auto2top: true,

// Plugins
plugins: [
]
Expand Down

0 comments on commit 8f44572

Please sign in to comment.