Latest #typespecs Threads Top

fuelen
I’m working on a small library (GitHub - fuelen/mold: A tiny, zero-dependency parsing library for external payloads · GitHub) where schem...
New
phcurado
I was checking the documentation for elixir and erlang types for ways to represent a map in the typespec. I have seen different projects...
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
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
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
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
Fl4m3Ph03n1x
Background I am doing a small function that takes a few parameters. One such parameter is a float() that must be <= 0. Now, if this w...
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
andreyvolokitin
If we want to introduce common reusable type, should we introduce separate Types module like so?: defmodule App.Shared.Types do @modul...
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

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
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
phcurado
I was checking the documentation for elixir and erlang types for ways to represent a map in the typespec. I have seen different projects...
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

Last Three Year's Trending Top

Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 14534 100
New
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
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
smangelsdorf
I’ve encountered some unusual behavior from Dialyzer while validating values from Application.get_env and reduced it down to the followin...
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
Fl4m3Ph03n1x
Background I am doing a small function that takes a few parameters. One such parameter is a float() that must be <= 0. Now, if this w...
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
fireproofsocks
This is more of a general question, but I’m wondering how other people in the community think about the pattern matching in function sign...
New
tim2CF
If we have function with typespec that always returns value with incorrect type @spec hello(integer()) :: map() def hello(int) do ...
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
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
Fl4m3Ph03n1x
Background So I have a behaviour that has some functions with optional parameters and I want a way to make them more readable: @type o...
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
  • Follow
  • Join
  • Shape
the conversation

Latest on Elixir Forum

Elixir Forum

Similar Portals

    None added yet

We're in Beta

About us Mission Statement