Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Reynir Björnsson <[email protected]>
  • Loading branch information
2 people authored and Cuihtlauac ALVARADO committed Nov 27, 2023
1 parent fc292a3 commit e40067d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/tutorials/language/0lg_10_polymorphic_variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ Note that these types are covariant because of the way their type parameters app

The function type is covariant on codomains. Casting a function is allowed if the target codomain is larger.
```ocaml
# let upcast_dom (f : int -> [ `Night ]) = (x :> int -> [ `Night | `Day ]);;
val f : (int -> [ `Night ]) -> int -> [ `Night | `Day ] = <fun>
# let upcast_dom (f : int -> [ `Night ]) = (f :> int -> [ `Night | `Day ]);;
val upcast_dom : (int -> [ `Night ]) -> int -> [ `Night | `Day ] = <fun>
```

Covariance means subtyping “goes in the same direction”:
Expand Down

0 comments on commit e40067d

Please sign in to comment.