Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 121 additions & 16 deletions docs/Prelude.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ require an identity element `id`, just composable morphisms.
One example of a `Semigroupoid` is the function type constructor `(->)`,
with `(<<<)` defined as function composition.

#### `semigroupoidArr`
#### `semigroupoidFn`

``` purescript
instance semigroupoidArr :: Semigroupoid Prim.Function
instance semigroupoidFn :: Semigroupoid Prim.Function
```


Expand Down Expand Up @@ -198,10 +198,10 @@ Instances must satisfy the following law in addition to the

- Identity: `id <<< p = p <<< id = p`

#### `categoryArr`
#### `categoryFn`

``` purescript
instance categoryArr :: Category Prim.Function
instance categoryFn :: Category Prim.Function
```


Expand All @@ -224,10 +224,17 @@ Instances must satisfy the following laws:
- Identity: `(<$>) id = id`
- Composition: `(<$>) (f <<< g) = (f <$>) <<< (g <$>)`

#### `functorArr`
#### `functorFn`

``` purescript
instance functorArr :: Functor (Prim.Function r)
instance functorFn :: Functor (Prim.Function r)
```


#### `functorArray`

``` purescript
instance functorArray :: Functor Prim.Array
```


Expand Down Expand Up @@ -299,10 +306,17 @@ laws:

Formally, `Apply` represents a strong lax semi-monoidal endofunctor.

#### `applyArr`
#### `applyFn`

``` purescript
instance applyFn :: Apply (Prim.Function r)
```


#### `applyArray`

``` purescript
instance applyArr :: Apply (Prim.Function r)
instance applyArray :: Apply Prim.Array
```


Expand Down Expand Up @@ -339,10 +353,17 @@ laws:
- Homomorphism: `(pure f) <*> (pure x) = pure (f x)`
- Interchange: `u <*> (pure y) = (pure ($ y)) <*> u`

#### `applicativeArr`
#### `applicativeFn`

``` purescript
instance applicativeArr :: Applicative (Prim.Function r)
instance applicativeFn :: Applicative (Prim.Function r)
```


#### `applicativeArray`

``` purescript
instance applicativeArray :: Applicative Prim.Array
```


Expand Down Expand Up @@ -407,10 +428,17 @@ do x <- m1
m3 x y
```

#### `bindArr`
#### `bindFn`

``` purescript
instance bindFn :: Bind (Prim.Function r)
```


#### `bindArray`

``` purescript
instance bindArr :: Bind (Prim.Function r)
instance bindArray :: Bind Prim.Array
```


Expand Down Expand Up @@ -438,10 +466,17 @@ Instances must satisfy the following laws in addition to the
- Left Identity: `pure x >>= f = f x`
- Right Identity: `x >>= pure = x`

#### `monadArr`
#### `monadFn`

``` purescript
instance monadFn :: Monad (Prim.Function r)
```


#### `monadArray`

``` purescript
instance monadArr :: Monad (Prim.Function r)
instance monadArray :: Monad Prim.Array
```


Expand Down Expand Up @@ -527,10 +562,10 @@ instance semigroupUnit :: Semigroup Unit
```


#### `semigroupArr`
#### `semigroupFn`

``` purescript
instance semigroupArr :: (Semigroup s') => Semigroup (s -> s')
instance semigroupFn :: (Semigroup s') => Semigroup (s -> s')
```


Expand All @@ -541,6 +576,13 @@ instance semigroupOrdering :: Semigroup Ordering
```


#### `semigroupArray`

``` purescript
instance semigroupArray :: Semigroup [a]
```


#### `Semiring`

``` purescript
Expand Down Expand Up @@ -568,6 +610,13 @@ Instances must satisfy the following laws:
- Right distributivity: `(a + b) * c = (a * c) + (b * c)`
- Annihiliation: `zero * a = a * zero = zero`

#### `semiringInt`

``` purescript
instance semiringInt :: Semiring Int
```


#### `semiringNumber`

``` purescript
Expand Down Expand Up @@ -611,6 +660,13 @@ laws:

- Additive inverse: `a + (-a) = (-a) + a = zero`

#### `ringInt`

``` purescript
instance ringInt :: Ring Int
```


#### `ringNumber`

``` purescript
Expand Down Expand Up @@ -655,6 +711,13 @@ laws:

- Remainder: `a / b * b + (a `mod` b) = a`

#### `moduloSemiringInt`

``` purescript
instance moduloSemiringInt :: ModuloSemiring Int
```


#### `moduloSemiringNumber`

``` purescript
Expand Down Expand Up @@ -770,13 +833,27 @@ instance eqBoolean :: Eq Boolean
```


#### `eqInt`

``` purescript
instance eqInt :: Eq Int
```


#### `eqNumber`

``` purescript
instance eqNumber :: Eq Number
```


#### `eqChar`

``` purescript
instance eqChar :: Eq Char
```


#### `eqString`

``` purescript
Expand Down Expand Up @@ -843,6 +920,13 @@ instance ordBoolean :: Ord Boolean
```


#### `ordInt`

``` purescript
instance ordInt :: Ord Int
```


#### `ordNumber`

``` purescript
Expand All @@ -857,6 +941,13 @@ instance ordString :: Ord String
```


#### `ordChar`

``` purescript
instance ordChar :: Ord Char
```


#### `ordUnit`

``` purescript
Expand Down Expand Up @@ -1144,13 +1235,27 @@ instance showBoolean :: Show Boolean
```


#### `showInt`

``` purescript
instance showInt :: Show Int
```


#### `showNumber`

``` purescript
instance showNumber :: Show Number
```


#### `showChar`

``` purescript
instance showChar :: Show Char
```


#### `showString`

``` purescript
Expand Down
Loading