Skip to content

Commit

Permalink
Replace type definitions with examples in "type constructors" part
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-calleja committed Mar 9, 2017
1 parent 0e439a8 commit 97da83c
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,14 @@ id="sanctuary-types-return">[1](#sanctuary-types)</sup>
- `42 :: Integer, Number` - "`42` is a member of type `Integer` or `Number`" (the
value of the expression `42` is `42` and we claim that it qualifies for
membership in both the `Integer` and `Number` types).
* _The value of an expression may be a type_
- When this is the case, the expression is called a "type expression"<sup
id="agith-return">[2](#agith)</sup>.
- The type `Type` is used to denote the type of a "type expression".<sup
id="thetypetype-return">[3](#thetypetype)</sup>
* _New types can be created via type constructors._
- Type constructors can take zero or more type arguments.
- `Name :: String` - "the type expression `Name` has type `String`".
- `Array :: Type -> Type` - "the type expression `Array` has type `Type ->
Type`". `Array` is a type constructor which takes a "type expression" and
returns a "type expression".
- `Array String :: Type`
- `Array` is a type constructor which takes one type argument.
- `Array String` is the type of all arrays of strings. Each of the
following has type `Array String`: `[]`, `['foo', 'bar', 'baz']`.
- `Array (Array String)` is the type of all arrays of arrays of strings.
Each of the following has type `Array (Array String)`: `[]`, `[ [], []
]`, `[ [], ['foo'], ['bar', 'baz'] ]`.
* _Lowercase letters stand for type variables._
- Type variables can take any type unless they have been restricted by means
of type constraints (see fat arrow below).
Expand Down Expand Up @@ -120,12 +116,6 @@ traverse :: Applicative f, Traversable t => t a ~> (TypeRep f, a -> f b) -> f (t
- - -
1. <a name="sanctuary-types"></a>See the [Types](https://sanctuary.js.org/#types)
section in `Sanctuary`'s docs for more info. [](#sanctuary-types-return)
2. <a name="agith"></a>See [A Gentle Introduction to
Haskell](https://www.haskell.org/tutorial/goodies.html) for more info.
[](#agith-return)
3. <a name="thetypetype"></a>See
[sanctuary-def](https://github.com/sanctuary-js/sanctuary-def) for more
info. [](#thetypetype-return)

## Prefixed method names

Expand Down

1 comment on commit 97da83c

@davidchambers
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.