From f6b0b2185f39510e42e4746cc58c5c62dd57f3a3 Mon Sep 17 00:00:00 2001 From: Alexey Romanov Date: Tue, 12 Oct 2010 10:49:10 +0400 Subject: [PATCH] More specific type for map_intersperse --- src/sqlite3.erl | 6 +++--- src/sqlite3_lib.erl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sqlite3.erl b/src/sqlite3.erl index 3baf435..daa2256 100644 --- a/src/sqlite3.erl +++ b/src/sqlite3.erl @@ -377,7 +377,7 @@ create_function(Db, 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 %% Converts an Erlang term to an SQL string. %% 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. %% @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). %%-------------------------------------------------------------------- -%% @spec value_to_sql(Value :: sql_value()) -> iodata() +%% @spec value_to_sql(Value :: sql_value()) -> iolist() %% @doc %% Converts an Erlang term to an SQL string. %% Currently supports integers, floats, 'null' atom, and iodata diff --git a/src/sqlite3_lib.erl b/src/sqlite3_lib.erl index 0822651..ad87eaf 100644 --- a/src/sqlite3_lib.erl +++ b/src/sqlite3_lib.erl @@ -256,7 +256,7 @@ drop_table(Tbl) -> %% @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, [Elem], _Sep) -> [Fun(Elem)]; map_intersperse(Fun, [Head | Tail], Sep) -> [Fun(Head), Sep | map_intersperse(Fun, Tail, Sep)].