Skip to content
Snippets Groups Projects
Commit 7a90020f authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Marge Bot
Browse files

docs: fix ScopedTypeVariables example (#24101)

The previous example didn't compile.

Furthermore, it wasn't demonstrating the point properly.
I have changed it to an example which shows that 'a' in the signature
must be the same 'a' as in the instance head.
parent 270867ac
No related branches found
No related tags found
No related merge requests found
...@@ -293,11 +293,11 @@ signatures/ of the methods. For example, the following will be accepted without ...@@ -293,11 +293,11 @@ signatures/ of the methods. For example, the following will be accepted without
explicitly enabling :extension:`ScopedTypeVariables`: :: explicitly enabling :extension:`ScopedTypeVariables`: ::
class D a where class D a where
m :: [a] -> a m :: a -> a
instance D [a] where instance Num a => D [a] where
m :: [a] -> [a] m :: [a] -> [a]
m = reverse m x = map (*2) x
Note that writing ``m :: [a] -> [a]`` requires the use of the Note that writing ``m :: [a] -> [a]`` requires the use of the
:extension:`InstanceSigs` extension. :extension:`InstanceSigs` extension.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment