Giter Club home page Giter Club logo

elixirdo's People

Contributors

slepher avatar

Watchers

 avatar  avatar

elixirdo's Issues

auto deriving support

acts like haskell:

data Vector = Vector Int Int deriving (Eq, Show)
data Matrix = Matrix Vector Vector deriving (Eq, Show)
deftype Vector :: %Vector{}, deriving: [:eq, :ord]
deftype Matrix :: %Matrix{}, deriving: [:eq, :ord]

multi parameter typeclass support

class (Monoid w, Monad m) => MonadWriter w m | m -> w
MonadWriter w m => MonadWriter w (MaybeT m)

current:

defclass monad_writer(m, m: monad)
definstance monad_writer(writer_t(w, m), m: monad, w: monoid) do

future:

defclass monad_writer(w, m) | (m -> w) <= (monoid(w), monad(m))
definstance monad_writer(w, maybe_t(m)) <= monad_writer(w, m)

All typeclass functions should be curry

all of this should be implemented
f: functor

Functor.fmap(a_b, functor_a, f) #Functor.fmap(a_b, functor_a, f)
Functor.fmap(a_b functor_a) #Functor.fmap(a_b, functor_a)
Functor.fmap(a_b) # &Functor.fmap(a_b, &1)
Functor.fmap() # &Functor.fmap(&1, &2)
f.fmap(a_b, functor_a) # Functor.fmap(a_b, functor_a, f)
f.fmap(a_b) # &Functor.fmap(a_b, &2, f)
f.fmap() # &Functor.fmap(&1, &2, f)

deftype auto generate type related functions

defmodule Elixirdo.Instance.Maybe do
  deftype maybe(a) :: %Just{value: a} | %Nothing{}

  defmodule Just do
    defstruct [:value]

    def new(a) do
      %Just{value: a}
    end

    def run(%Just{value: a}) do
      a
    end
  end

  defmodule Nothing do
    defstruct []

    def new() do
      %Nothing{}
    end
  end
end

should be replaced by

defmodule Elixirdo.Instance.Maybe do
  deftype maybe(a) :: %Just{run: a} | %Nothing{}
end

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.