git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update types.rst
8b0704cPhil Freeman
docs/source/types.rst+13
@@ -222,6 +222,19 @@ test = poly (\n -> n + 1)
222
222
223since the skolemized type variable `a` does not unify with `Number`.
223since the skolemized type variable `a` does not unify with `Number`.
224
224
225+## Type Synonyms
226+
227+For convenience, it is possible to declare a synonym for a type using the `type` keyword. Type synonyms can include type arguments.
228+
229+For example:
230+
231+```haskell
232+type Foo = { foo :: Number, bar Number }
233+
234+addFoo :: Foo -> Number
235+addFoo = \o -> o.foo + o.bar
236+```
237+
225## Type Inference
238## Type Inference
226
239
227All types can be inferred, but annotations can optionally be provided.
240All types can be inferred, but annotations can optionally be provided.