GithubHelp home page GithubHelp logo

Comments (3)

slepher avatar slepher commented on August 25, 2024

erlando_type error_m

-erlando_type(error_m, [error_m/2]).
-export_type([error_m/2, ok/1, error/1]).
-type error_m(E, A) :: ok(A) | error(E).
-type ok(A) :: ok | {ok, A}.
-type error(E) :: {error, E}.

convert to erl_types

{c,union,
       [{c,atom,[ok],unknown},
        none,none,none,none,none,
        {c,tuple_set,
           [{2,
             [{c,tuple,
                 [{c,atom,[error],unknown},any],
                 {2,{c,atom,[error],unknown}}},
              {c,tuple,
                 [{c,atom,[ok],unknown},any],
                 {2,{c,atom,[ok],unknown}}}]}],
           unknown},
        none,none,none],
       unknown}

generates pattern

type({ok, _}) ->
  error_m; 
type({error, _}) ->
  error_m;
type(ok) ->
  error_m

erlando_type state_t

-erlando_type({state_t, [state_t/3]}).
-export_type([state_t/3]).
-type state_t(S, M, A) :: {state_t, inner_t(S, M, A)}.
-type inner_t(S, M, A) :: fun((S) -> monad:m(M, {A, S})).

converted to erl_types

{c,tuple,
       [{c,atom,[state_t],unknown},
        {c,function,
           [{c,product,[{c,var,'S',unknown}],unknown},any],
           unknown}],
       {2,{c,atom,[state_t],unknown}}}

generates pattern

type({state_t, Args1}) when is_function(Args1) ->
  state_t

from erlando.

slepher avatar slepher commented on August 25, 2024

move to branch type_by_erlang
request erlang R20 or higher

from erlando.

slepher avatar slepher commented on August 25, 2024

support R19 by moving dialyzer_utils.erl and erl_types.erl to this project from erlang otp R20

from erlando.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.