%%%-------------------------------------------------------------------
  @author   <  >
   ( C ) 2017 ,  
%%% @doc
%%%
%%% @end
  Created : 20 Oct 2017 by   <  >
%%%-------------------------------------------------------------------
-module(fold).

%% API
-export([to_list_of/2, fold_map_of/3]).

%%%===================================================================
%%% API
%%%===================================================================
to_list_of(Fold, S) ->
    undetermined:run(const:run_const((Fold(fun(A) -> const:const([A]) end))(S)), list_instance).

fold_map_of(Fold, AR, S) ->
    const:run_const((Fold(fun(A) -> const:const(AR(A)) end))(S)).

%%--------------------------------------------------------------------
%% @doc
  
%% @end
%%--------------------------------------------------------------------

%%%===================================================================
  Internal functions
%%%===================================================================

-------------------------------------------------------------------
 @doc

 @end
-------------------------------------------------------------------
 API
===================================================================
 API
===================================================================
--------------------------------------------------------------------
 @doc
 @end
--------------------------------------------------------------------
===================================================================
===================================================================
  @author   <  >
   ( C ) 2017 ,  
  Created : 20 Oct 2017 by   <  >
-module(fold).

-export([to_list_of/2, fold_map_of/3]).

to_list_of(Fold, S) ->
    undetermined:run(const:run_const((Fold(fun(A) -> const:const([A]) end))(S)), list_instance).

fold_map_of(Fold, AR, S) ->
    const:run_const((Fold(fun(A) -> const:const(AR(A)) end))(S)).

  

  Internal functions
