Packages

Tastoids are a uniform abstraction of 'taste' and Algebra thereof.

Current section

Files

Jump to
tastoids src tastoids@from.erl
Raw

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(ELX) -> tastoids@tastoid:tastoid(ELX).
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(ELZ) -> tastoids@tastoid:tastoid(ELZ).
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(EMB) -> tastoids@tastoid:tastoid(EMB).
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(EMD, float()) -> tastoids@tastoid:tastoid(EMD).
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(EMF) -> tastoids@tastoid:tastoid(EMF).
pass(Index) ->
tastoids@tastoid:from_impression(Index, pass).