@@ -75,7 +75,7 @@ True
76## Structural subtyping
76## Structural subtyping
78−A record is a (structural) `subtype' of another, if its fields are a subset of
78+A record is a (structural) `subtype' of another, if its fields are a superset of
79those of the other.
79those of the other.
@@ -103,18 +103,18 @@ Animal {name = "Tunyasz", age = 50}
103>>> smash (Animal "dog" 10) human
103>>> smash (Animal "dog" 10) human
104Human {name = "dog", age = 10, address = "London"}
104Human {name = "dog", age = 10, address = "London"}
106−-- 'subtype' is a lens that focuses on a subrecord of a larger record:
106+-- 'super' is a lens that focuses on a subrecord of a larger record:
107−>>> human ^. subtype @Animal
107+>>> human ^. super @Animal
108Animal {name = "Tunyasz", age = 50}
108Animal {name = "Tunyasz", age = 50}
111−We can apply a function that operates on a subtype to the larger structure,
111+We can apply a function that operates on a supertype to the larger (subtype)
112−by focusing on the subtype first:
112+structure, by focusing on the supertype first:
114```haskell
114```haskell
115growUp :: Animal -> Animal
115growUp :: Animal -> Animal
116growUp (Animal name age) = Animal name (age + 50)
116growUp (Animal name age) = Animal name (age + 50)
118−>>> human & subtype @Animal %~ growUp
118+>>> human & super @Animal %~ growUp
119Human {name = "Tunyasz", age = 60, address = "London"}
119Human {name = "Tunyasz", age = 60, address = "London"}