This Week's Trending Top

This Month's Trending Top

This Year's Trending Top

eksperimental
I am about to publish a few projects, and I even though they are currently licensed under the MIT license, I came to the unexpected reali...
New
fuelen
I’m working on a small library (GitHub - fuelen/mold: A tiny, zero-dependency parsing library for external payloads · GitHub) where schem...
New

Last Three Year's Trending Top

zachdaniel
I was hoping I could get something like this working: defmodule FooRegistry do @foos [ FirstFoo, SecondFoo, ThirdFoo ] ...
New
stevensonmt
I’d like to use typespecs to document that certain functions take one of a few different tensors with specific shape/values like @type m...
New
joshua.aug
I’m looking at an existing project with code like this: @spec default_rating :: List.t() @spec default_rating(non_neg_integer()) :: ...
New
andreyvolokitin
If we want to introduce common reusable type, should we introduce separate Types module like so?: defmodule App.Shared.Types do @modul...
New
stevejay
The Typespecs reference section in the Elixir docs states the following: Some shorthands are allowed, such as [...] , <<>> ...
New
fireproofsocks
When adding a @spec to a function, is there any functional difference between doing something like @spec my_func(input :: binary()) :: a...
New
Gigitsu
Hi everyone :waving_hand: I’m trying to improve the typespecs in my application contexts, but I’m running into dialyzer errors when deal...
New
mudasobwa
I need to get specs for the function which may be located in the external module, like Process or :math. Dialyzer source code does rough...
New
bvobart
For a list of integers, I can simply write a typespec like this: @type foo() :: [integer()] # or list(integer()) But what about a Strea...
New
Fl4m3Ph03n1x
Background I have a structure where the new function requires a parameter to be part of a closed set of values (think of it as an enum). ...
New
fhunleth
I’d recently was asked why you couldn’t get help on types via the IEx t helper with Nerves. The reason is that the type docs are in the B...
New
smangelsdorf
I’ve encountered some unusual behavior from Dialyzer while validating values from Application.get_env and reduced it down to the followin...
New
James_E
I’m writing a multiset library. It’s got 2 modules: one which works on raw “multisets” (which are maps of elements to quantities), and an...
New
skyqrose
What’s the type to use for a function that returns a quote? For example: @spec f() :: what_goes_here def f() do quote do code e...
New
feviskus
Hi folks, I want to create a function spec which tells the compiler that the return type will be conforming to a given Behavior. This qu...
New

Trending Over Three Years Top

jc00ke
Expanding on this topic: Map typespec question Let’s say I have a map with required and optional keys. I’d like to document both, but ba...
New
vrod
I’m pretty new to Elixir. One thing I don’t think I understand is the typespecs, specifically when they deal with structs. A common patt...
New
belaustegui
I have an Ecto schema and I am wondering about how to represent it in typespecs. Suppose that my schema is like this: defmodule User do...
New
tim2CF
If we have function with typespec that always returns value with incorrect type @spec hello(integer()) :: map() def hello(int) do ...
New
ilya-kolpakov
Is there a way to define a function type and use it later in the specs? Something like @type task :: fun(any) -> {:ok, pid} | {:error...
New
Sgoettschkes
Hi, I’m trying to find examples of typespec usage with optional arguments. I assume the following is one way to write a spec with option...
New
Aetherus
I want to define a type using typespec like @type foo :: "bar" | "baz" But the compiler shows the following error unexpected expressi...
New
lessless
For example I have multiple currencies dollar.ex defmodule Multicurrency.Currency.Dollar do @enforce_keys [:amount] defstruct [:amo...
New
dimitarvp
Given this module: defmodule A do @type size :: pos_integer() defguard is_size(x) when is_integer(x) and x > 0 def default_size...
New
fireproofsocks
I’ve got an Ecto schema that has a column where I store some random data from a 3rd-party provider. This is mostly just for book-keeping...
New
taro
I’ve learnt that phx.gen.auth uses Base.url_encode64() to convert binary() to String.t(). If I just pass a binary, consumer would malfun...
New
chulkilee
I wrapped an API using pagination with Stream.unfold so that it returns Enum.t (Enumerable.t). Is it possible to specify @spec of values...
New
Crowdhailer
NOTE all these questions are related to my use of dialyxir. Type variables From the erlang documentation. Type variables can be used i...
New
DaAnalyst
Hi, Is there any way to specify a map or a structure extension using typespecs, e.g.: @type map1() :: %{ field1: String.t(), field2...
New
fireproofsocks
I’m confused… when grooming the docs for https://elixir-lang.org/getting-started/typespecs-and-behaviours.html I got the feedback that mu...
New
  • Follow
  • Join
  • Shape
the conversation

Latest on Elixir Forum

Elixir Forum

Similar Portals

    None added yet

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews