X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2F_week7_monads.mdwn;h=75bc2051ee224c01dab42c54a733f32949becfdc;hp=e8785bbdfdfd03bc78c0297d98d9f241da35a534;hb=12c84449781c99ba26fa73fe86afff8b6408000d;hpb=6cb98be545c373b3eb4aa5be81cb51982f2dc458 diff --git a/topics/_week7_monads.mdwn b/topics/_week7_monads.mdwn index e8785bbd..75bc2051 100644 --- a/topics/_week7_monads.mdwn +++ b/topics/_week7_monads.mdwn @@ -1,6 +1,4 @@ -
α, β, γ, ...
to represent types. We'll
+use `P`, `Q`, `R`, and `S` as metavariables over type schemas, where a
+type schema is a type expression that may or may not contain unbound
+type variables. For instance, we might have
+
+ P â¡ Int
+ P ⡠α -> α
+ P â¡ âα. α -> α
+ P â¡ âα. α -> β
+
+etc.
+
+A box type will be a type expression that contains exactly one free
+type variable. Some examples (using OCaml's type conventions):
+
+ α Maybe
+ α List
+ (α, P) Tree (assuming P contains no free type variables)
+ (α, α) Tree
+
+The idea is that whatever type the free type variable α might be,
+the boxed type will be a box that "contains" an object of type α.
+For instance, if `α List` is our box type, and α is the basic type
+Int, then in this context, `Int List` is the type of a boxed integer.
+
+We'll often write box types as a box containing the value of the free
+type variable. So if our box type is `α List`, and `α == Int`, we
+would write
+
+Int |