mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
Add some clarity by distinguishing var names
This commit is contained in:
@@ -10,11 +10,11 @@ The `Stream.from` function lets you define a function for custom fitting
|
|||||||
data structures into streams. Let's take a look:
|
data structures into streams. Let's take a look:
|
||||||
|
|
||||||
```reason
|
```reason
|
||||||
let pokemon = [| "bulbasaur", "charmander", "squirtle" |];
|
let pokemons = [| "bulbasaur", "charmander", "squirtle" |];
|
||||||
|
|
||||||
let poke_stream: Stream.t(string) =
|
let poke_stream: Stream.t(string) =
|
||||||
Stream.from(i =>
|
Stream.from(i =>
|
||||||
switch (pokemon[i]) {
|
switch (pokemons[i]) {
|
||||||
| pokemon => Some(pokemon)
|
| pokemon => Some(pokemon)
|
||||||
| exception (Invalid_argument("index out of bounds")) => None
|
| exception (Invalid_argument("index out of bounds")) => None
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user