Commit a45cf06a authored by Ian Lynagh's avatar Ian Lynagh

Correct an example in the users guide

parent 7e97bc16
......@@ -2002,9 +2002,9 @@ of the data constructor. For GADTs, the field may mention only types
that appear as a simple type-variable argument in the constructor's result
type</emphasis>. For example:
<programlisting>
data T a where { T1 { f1::a, f2::(a,b) } :: T a } -- b is existential
upd1 t x = t { f1=x } -- OK: upd1 :: T a -> b -> T b
upd2 t x = t { f2=x } -- BAD (f2's type mentions b, which is
data T a b where { T1 { f1::a, f2::b, f3::(b,c) } :: T a b } -- c is existential
upd1 t x = t { f1=x } -- OK: upd1 :: T a b -> a' -> T a' b
upd2 t x = t { f3=x } -- BAD (f3's type mentions c, which is
-- existentially quantified)
data G a b where { G1 { g1::a, g2::c } :: G a [c] }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment