slepher / elixirdo Goto Github PK
View Code? Open in Web Editor NEWerlangdo rewrite in elixir
erlangdo rewrite in elixir
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]
law defined in typeclass is not implemented yet
current form:
f: applicative
Applicative.ap(applicative_f, applicative_a, f)
future form:
f: applicative
f.ap(applicative_f, applicative_a)
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 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)
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
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.