Current section
Files
Jump to
Current section
Files
src/tastoids@from.erl
-module(tastoids@from).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-define(FILEPATH, "src/tastoids/from.gleam").
-export([like/1, dislike/1, meh/1, saw/2, pass/1]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" Helpful shorthands for quickly making a Tastoid from\n"
" a like, dislike, 'meh' or pass (zero-ish Tastoid)\n"
).
-file("src/tastoids/from.gleam", 9).
?DOC(" Coerce any `index` into a simple `Tastoid` with a positive sentiment\n").
-spec like(ECK) -> tastoids@tastoid:tastoid(ECK).
like(Index) ->
tastoids@tastoid:from_impression(Index, yum).
-file("src/tastoids/from.gleam", 14).
?DOC(" Coerce any `index` into a simple `Tastoid` with a negative sentiment\n").
-spec dislike(ECM) -> tastoids@tastoid:tastoid(ECM).
dislike(Index) ->
tastoids@tastoid:from_impression(Index, yuck).
-file("src/tastoids/from.gleam", 19).
?DOC(" Coerce any `index` into a simple `Tastoid` with a weak negative sentiment.\n").
-spec meh(ECO) -> tastoids@tastoid:tastoid(ECO).
meh(Index) ->
tastoids@tastoid:from_impression(Index, meh).
-file("src/tastoids/from.gleam", 25).
?DOC(
" Coerce any `index` into a simple `Tastoid` with a specific worth\n"
" (weight coefficient/multiplier for `this`'s value)\n"
).
-spec saw(ECQ, float()) -> tastoids@tastoid:tastoid(ECQ).
saw(Index, Weight) ->
tastoids@tastoid:from_impression(Index, {saw, Weight}).
-file("src/tastoids/from.gleam", 31).
?DOC(
" Coerce any `index` into a simple `Tastoid` with no sentiment or\n"
" contribution (the empty tastoid/`Insipoid`)\n"
).
-spec pass(ECS) -> tastoids@tastoid:tastoid(ECS).
pass(Index) ->
tastoids@tastoid:from_impression(Index, pass).