... | @@ -278,11 +278,11 @@ brings the name `P` as a pattern synonym into the module-level scope. |
... | @@ -278,11 +278,11 @@ brings the name `P` as a pattern synonym into the module-level scope. |
|
The pattern synonym `P` is assigned a *pattern type * of the form
|
|
The pattern synonym `P` is assigned a *pattern type * of the form
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
P :: ty requires CReq provides CProv
|
|
pattern CProv => P t1 t2 ... tN :: CReq => t
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
where `ty` is a simple type with no context, and `CReq` and `CProv` are type contexts.
|
|
where `t` is a simple type with no context, and `CReq` and `CProv` are type contexts.
|
|
|
|
|
|
|
|
|
|
A pattern synonym of this type can be used in a pattern if the
|
|
A pattern synonym of this type can be used in a pattern if the
|
... | @@ -310,7 +310,7 @@ pattern P x <- MkT (f -> True) x |
... | @@ -310,7 +310,7 @@ pattern P x <- MkT (f -> True) x |
|
the pattern type of `P` is
|
|
the pattern type of `P` is
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
P :: b -> T a requires (Show a) provides (Eq b)
|
|
pattern (Eq b) => P b :: (Show a) => T a
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | | ... | |