diff options
author | Christian Takle <christian.takle@gmail.com> | 2021-06-21 23:03:26 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-06-24 20:36:32 -0400 |
commit | c1c29808e32c95e2843ae6d57931ceca892db6fd (patch) | |
tree | c68272e57f78d0f2c380e6d07fd288f99f57ae2f /docs | |
parent | 4d5967b5148d5502d7c53a5a321919779c3165e4 (diff) | |
download | haskell-c1c29808e32c95e2843ae6d57931ceca892db6fd.tar.gz |
Update quantified_constraints.rst
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/exts/quantified_constraints.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/users_guide/exts/quantified_constraints.rst b/docs/users_guide/exts/quantified_constraints.rst index 769570fea2..2ed53b6c4a 100644 --- a/docs/users_guide/exts/quantified_constraints.rst +++ b/docs/users_guide/exts/quantified_constraints.rst @@ -18,7 +18,7 @@ which give a new level of expressiveness in constraints. For example, consider : instance (Eq a, ???) => Eq (Rose f a) where (Branch x1 c1) == (Branch x2 c2) - = x1==x1 && c1==c2 + = x1==x2 && c1==c2 From the ``x1==x2`` we need ``Eq a``, which is fine. From ``c1==c2`` we need ``Eq (f (Rose f a))`` which is *not* fine in Haskell today; we have no way to solve such a constraint. @@ -29,7 +29,7 @@ is *not* fine in Haskell today; we have no way to solve such a constraint. => Eq (Rose f a) where (Branch x1 c1) == (Branch x2 c2) - = x1==x1 && c1==c2 + = x1==x2 && c1==c2 Here, the quantified constraint ``forall b. (Eq b) => Eq (f b)`` behaves a bit like a local instance declaration, and makes the instance typeable. |