alexocode / ex_union Goto Github PK
View Code? Open in Web Editor NEWTagged unions for Elixir. Just that.
License: MIT License
Tagged unions for Elixir. Just that.
License: MIT License
๐๐ผ Hi there. Thanks for sharing this library ๐๐ผ .
I'm playing around with it to implement some basic union types. However, Elixir's LD Dialyzer is complaining about overloaded contracts and invalid specifications:
defmodule MyApp.Result do
import ExUnion
defunion(ok(value) | error(value))
end
Overloaded contract for 'Elixir.MyApp.Result.Error':new/1 has overlapping domains; such contracts are currently unsupported and are simply ignored (ElixirLS Dialyzer)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Overloaded contract for 'Elixir.MyApp.Result.Ok':new/1 has overlapping domains; such contracts are currently unsupported and are simply ignored (ElixirLS Dialyzer)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Invalid type specification for function 'Elixir.MyApp.Result':'__union__'/0. The success typing is
() ->
#{'__struct__' := 'Elixir.ExUnion.Definition',
'module' := 'Elixir.MyApp.Result',
'name' := <<_:48>>,
'types' :=
[#{'__struct__' := 'Elixir.ExUnion.Definition.Type',
'fields' := [any(), ...],
'module' :=
'Elixir.MyApp.Result.Error' |
'Elixir.MyApp.Result.Ok',
'name' := 'error' | 'ok'},
...]} (ElixirLS Dialyzer)
Are you also experiencing this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.