1:- module(sugar, [
    2    '.'/3       % +Ps, +Term, -Result
    3]).

syntactic sugar

It's all about "." ;)

author
- Hongxin Liang
license
- Apache License Version 2.0 */
 .(+Ps, +Term, -Result) is semidet
Syntactic sugar for invoking APIs.
   16'.'(Ps, cluster, [cluster, Ps]) :- !.
   17'.'(Ps, nodes, [nodes, Ps]) :- !.
   18'.'(Ps, indices, [indices, Ps]) :- !.
   19'.'(Ps, snapshots, [snapshots, Ps]) :- !.
   20
   21'.'([Module, Ps], Term, true) :- !,
   22    Term =.. [Name|Args],
   23    TermWithPs =.. [Name|[Ps|Args]],
   24    ModuledTerm =.. [:, Module, TermWithPs],
   25    call(ModuledTerm).
   26
   27'.'(Ps, Term, true) :-
   28    Term =.. [Name|Args],
   29    TermWithPs =.. [Name|[Ps|Args]],
   30    ModuledTerm =.. [:, plasticsearch, TermWithPs],
   31    call(ModuledTerm)