Skip to content

Commit 2a449df

Browse files
committed
fix format and date
1 parent c91b2eb commit 2a449df

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

_blogposts/2025-04-05-introducing-unified-operators.mdx renamed to _blogposts/2025-04-11-introducing-unified-operators.mdx

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: rescript-team
3-
date: "2025-04-05"
3+
date: "2025-04-11"
44
title: "Rethinking Operators: How ReScript Simplifies Arithmetic and Beyond"
55
badge: roadmap
66
description: |
@@ -40,9 +40,9 @@ Some operators are available only as functions. Instead of `<<` and `>>`, we use
4040
ReScript has multiple "add operator" syntaxes for every primitive type.
4141

4242
```res
43-
let add_int = 1 + 2
44-
let add_float = 1.0 +. 2.0
45-
let concat_string = "Hello" ++ ", World!"
43+
let addInt = 1 + 2
44+
let addFloat = 1.0 +. 2.0
45+
let concatString = "Hello" ++ ", World!"
4646
```
4747

4848
We ran into the same issue again when we added `bigint` support.
@@ -52,7 +52,7 @@ What other operator syntax could we introduce to add two bigint values? There we
5252
It was inconvenient because we had to shadow the definition every time.
5353

5454
```res
55-
let add_bigint = {
55+
let addBigInt = {
5656
open BigInt!
5757
1n + 2n
5858
}
@@ -124,8 +124,8 @@ More specifically, the following rules are added to the primitive translation pr
124124
> Before handling a primitive, if the primitive operation matches the form of `lhs -> rhs -> result` or `lhs -> result`
125125
>
126126
> 1. If the `lhs` type is a primitive type, unify the `rhs` and the `result` type to the `lhs` type.
127-
> 2. If the `lhs` type is not a primitive type but the `rhs` type is, unify `lhs` and the `result` type to the `rhs` type.
128-
> 3. If both `lhs` type and `rhs` type is not a primitive type, unify the whole types to the `int`.
127+
> 2. If the `lhs` type is not a primitive type but the `rhs` type is, unify `lhs` and the `result` type to the `rhs` type.
128+
> 3. If both `lhs` type and `rhs` type is not a primitive type, unify the whole types to the `int`.
129129
130130
It changes the type inference like
131131

0 commit comments

Comments
 (0)