Skip to content

Commit

Permalink
reword
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Nov 21, 2023
1 parent 6ca4877 commit d63ce56
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1486,8 +1486,7 @@ Merged
; => true
```

`:union` is similar to `:or`, except map schemas in different disjuncts are merged
together with `:or`.
`:union` is similar to `:or`, except `:union` combines map schemas in different disjuncts with `:or`.
For example, `UnionMaps` is equivalent to `[:map [:x [:or :int :string]] [:y [:or :int :string]]]`.

```clojure
Expand All @@ -1512,8 +1511,8 @@ For example, `UnionMaps` is equivalent to `[:map [:x [:or :int :string]] [:y [:o
; => true
```

`:merge` and `:union` differ on schemas with common keys: right-most
map schemas win with `:merge`, and schemas are joined with `:or` with `:union`.
`:merge` and `:union` differ on schemas with common keys. `:merge` chooses the right-most
schema of common keys, and `:union` combines them with `:or`.
For example, `MergedCommon` is equivalent to `[:map [:x :int]]`, and `UnionCommon`
is equivalent to `[:map [:x [:or :string :int]]]`.

Expand Down

0 comments on commit d63ce56

Please sign in to comment.