Files
postgrest/docs/Function.md
T
2016-12-10 16:01:47 +00:00

1.0 KiB

Functions

Composition

$

($) :: (a -> b) -> a -> b

Example:

.

(.) :: (b -> c) -> (a -> b) -> a -> c

Example:

&

(&) :: a -> (a -> b) -> b

Example:

flip

flip :: (a -> b -> c) -> b -> a -> c

Example:

on

on :: (b -> b -> c) -> (a -> b) -> a -> a -> c

Example:

const

const :: a -> b -> a

Example:

fix

fix :: (a -> a) -> a

Example:

identity

identity :: a -> a

The identity function maps any value to itself.

applyN

Apply a function to a value n times.

Example:

applyN :: Int -> (a -> a) -> a -> a
> applyN 25 (+2) 0
50

> applyN 3 (1:) []
[1,1,1]

Strictness

$!

($!) :: NFData a => (a -> b) -> a -> b

Example:

$!!

($!!) :: NFData a => (a -> b) -> a -> b

Example:

force

force :: NFData a => a -> a

Example: