More specific type for map_intersperse

This commit is contained in:
Alexey Romanov
2010-10-12 10:49:10 +04:00
parent 37aa64dd5f
commit f6b0b2185f
2 changed files with 4 additions and 4 deletions

View File

@@ -377,7 +377,7 @@ create_function(Db, FunctionName, Function) ->
gen_server:call(Db, {create_function, FunctionName, Function}). gen_server:call(Db, {create_function, FunctionName, Function}).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% @spec value_to_sql_unsafe(Value :: sql_value()) -> iodata() %% @spec value_to_sql_unsafe(Value :: sql_value()) -> iolist()
%% @doc %% @doc
%% Converts an Erlang term to an SQL string. %% Converts an Erlang term to an SQL string.
%% Currently supports integers, floats, 'null' atom, and iodata %% Currently supports integers, floats, 'null' atom, and iodata
@@ -391,11 +391,11 @@ create_function(Db, FunctionName, Function) ->
%% Reexported from sqlite3_lib:value_to_sql/1 for user convenience. %% Reexported from sqlite3_lib:value_to_sql/1 for user convenience.
%% @end %% @end
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
-spec value_to_sql_unsafe(sql_value()) -> iodata(). -spec value_to_sql_unsafe(sql_value()) -> iolist().
value_to_sql_unsafe(X) -> sqlite3_lib:value_to_sql_unsafe(X). value_to_sql_unsafe(X) -> sqlite3_lib:value_to_sql_unsafe(X).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% @spec value_to_sql(Value :: sql_value()) -> iodata() %% @spec value_to_sql(Value :: sql_value()) -> iolist()
%% @doc %% @doc
%% Converts an Erlang term to an SQL string. %% Converts an Erlang term to an SQL string.
%% Currently supports integers, floats, 'null' atom, and iodata %% Currently supports integers, floats, 'null' atom, and iodata

View File

@@ -256,7 +256,7 @@ drop_table(Tbl) ->
%% @doc Works like string:join for iolists %% @doc Works like string:join for iolists
-spec map_intersperse(fun((X) -> Z), [X], Y) -> [Z | Y]. -spec map_intersperse(fun((X) -> iolist()), [X], [iolist() | integer()]) -> iolist().
map_intersperse(_Fun, [], _Sep) -> []; map_intersperse(_Fun, [], _Sep) -> [];
map_intersperse(Fun, [Elem], _Sep) -> [Fun(Elem)]; map_intersperse(Fun, [Elem], _Sep) -> [Fun(Elem)];
map_intersperse(Fun, [Head | Tail], Sep) -> [Fun(Head), Sep | map_intersperse(Fun, Tail, Sep)]. map_intersperse(Fun, [Head | Tail], Sep) -> [Fun(Head), Sep | map_intersperse(Fun, Tail, Sep)].