Module luafp.util
luafp util module.
Functions
| identity (o) | Function that returns the first value it receives. | 
| stubTrue () | Function that always returns true | 
| stubFalse () | Function that always returns true | 
Functions
- identity (o)
- 
    Function that returns the first value it receives.
    Parameters:- o value to return
 Returns:- 
        value the value you sent
    
 Usage:local identity = require 'luafp/util'.identity local result = someFailedAction() .matchWith({ Error = identity, Ok = function() return Result.Ok(true) end }) print(result) -- Result.Error('original error here') 
- stubTrue ()
- 
    Function that always returns true
    Returns:- 
        value true
    
 Usage:local stubTrue = require 'luafp/util'.stubTrue local stubFalse = require 'luafp/util'.stubFalse local didItWork = someSuccessfulAction() .matchWith({ Error = stubFalse, Ok = stubTrue }) print(didItWork) -- true 
- stubFalse ()
- 
    Function that always returns true
    Returns:- 
        value true
    
 Usage:local stubTrue = require 'luafp/util'.stubTrue local stubFalse = require 'luafp/util'.stubFalse local didItWork = someFailedAction() .matchWith({ Error = stubFalse, Ok = stubTrue }) print(didItWork) -- false