A Identity is another way of storing two values in a single value. Elements of a Identity do not need to be of the same type
Implements: Monad, Semigroup
, Setoid
Identity constructor
Param | Type | Description |
---|---|---|
v | any |
Value to be wrapped by identity. This cannot be undefiend |
Identity constructor
Param | Type | Description |
---|---|---|
v | any |
Value to be wrapped by identity. This cannot be undefiend |
Check if the values of the current Identity is equal to the values of the passed Identity. This checkes for ===
'ty of the values of the 2 Identities
Param | Type | Description |
---|---|---|
j | Identity |
The Identity to compare with |
Concat the current Identity with the passed one. Note that values of both the Identities should be of the same type and should be of type semigroup for cancat to work
Param | Type | Description |
---|---|---|
p | Identity |
Identity to concat |
Get the value within the Identity
Apply the function to the value of the current Identity
Param | Type | Description |
---|---|---|
f | function |
Function |
Chain a computation that returns an Identity
Param | Type | Description |
---|---|---|
f | function |
Function that returns another Identity |
Get a stringified version of the Identity
** TODO: Add some examples **