Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 597c36d613627b4baec185ca58e410065fbd3437
https://github.com/tribe29/checkmk/commit/597c36d613627b4baec185ca58e410065…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2020-10-13 (Tue, 13 Oct 2020)
Changed paths:
M cmk/utils/type_defs.py
M tests/unit/cmk/utils/test_type_defs.py
Log Message:
-----------
Complete Result API
We are now feature complete with regard to OCaml.
Note that `bind` and `fold` higher-order functions and the conversions
to sequence or list are not explicitly implemented. The functionality
is nevertheless available such that:
- `bind: ('a, 'e) result -> ('a -> ('b, 'e) result) ->
('b, 'e) result`
is done with `Result.__init__()` followed by either `Result.map()` or
a call to a function that takes the `Result`.
- `fold: ~ok:('a -> 'c) -> ~error:('e -> 'c) -> ('a,
'e) result -> 'c`
can be implemented with type dispatch followed by handling
`OKResult.ok` and `ErrorResult.error`.
- `to_list` is done with `list()` as `list(Result[T, E]) -> List[T]`
since `Result.__iter__()` is implemented.
- `to_seq` is done with `for v in result: ...`, also thanks
to `Result.__iter__()`
Change-Id: Ic557e9a7df62b6c254af45ed093c74d07995f62b
Commit: 9326774f1439c9d503acd518296f94824afa3213
https://github.com/tribe29/checkmk/commit/9326774f1439c9d503acd518296f94824…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2020-10-13 (Tue, 13 Oct 2020)
Changed paths:
M cmk/base/checkers/_abstract.py
M cmk/base/checkers/_checkers.py
M cmk/base/inventory.py
M cmk/fetchers/_base.py
M cmk/fetchers/controller.py
A cmk/utils/_type_defs_result.py
M cmk/utils/type_defs.py
M tests/unit/cmk/base/checkers/test_agent.py
M tests/unit/cmk/base/checkers/test_host_sections.py
M tests/unit/cmk/base/checkers/test_ipmi_management_board_data_source.py
M tests/unit/cmk/base/checkers/test_piggy_back_data_source.py
M tests/unit/cmk/base/checkers/test_snmp_data_source.py
M tests/unit/cmk/base/checkers/test_tcp_data_source.py
M tests/unit/cmk/base/test_automations_check_mk.py
M tests/unit/cmk/base/test_modes_check_mk.py
M tests/unit/cmk/fetchers/test_controller.py
M tests/unit/cmk/fetchers/test_fetchers.py
M tests/unit/cmk/utils/test_type_defs.py
A tests/unit/cmk/utils/test_type_defs_result.py
Log Message:
-----------
Move `Result` type to its own file
Change-Id: I58762a1b0620960dccca4814d412df143c3c8bf7
Compare:
https://github.com/tribe29/checkmk/compare/626ac72d61b1...9326774f1439