We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies.

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies. Less

We use cookies and other tracking technologies... More

Login or register
to publish this job!

Login or register
to save this job!

Login or register
to save interesting jobs!

Login or register
to get access to all your job applications!

Login or register to start contributing with an article!

Login or register
to see more jobs from this company!

Login or register
to boost this post!

Show some love to the author of this blog by giving their post some rocket fuel πŸš€.

Login or register to search for your ideal job!

Login or register to start working on this issue!

Login or register
to save articles!

Login to see the application

Engineers who find a new job through Functional Works average a 15% increase in salary πŸš€

You will be redirected back to this page right after signin

Blog hero image

"Code like Lego(tm)"

R Headley 23 November, 2021 | 1 min read

Love at first sight :)

When I first stumbled across Elixir I was thrilled to discover the syntax was almost identical to that of the Ruby language. The power of Erlang available through a Ruby-like syntax. "What a find!", I thought.

A study project

To learn Elixir basics I dreamt up a trivial study project based around the beautiful simplicity of functions that always return one of two things, {:ok, result} or {:error, reason}.

The scene was set!

If our functions only return two types of tuple it makes it easy for us to chain them together:

One.func(45, "a string", 3.142)
|> Two.func("foobar")
|> Three.func()

Function Two.func/2 knows exactly what to expect from One.func/3; function Three.func/1 knows exactly what to expect from Two.func/2. Great!

But then I said, let's make all functions look the same (argument-wise) and call them 'modifiers' (after all, that's what they are!)

Code like Lego(tm)

ModifyChain provides the scaffolding that allows you to flexibly 'run' a 'chain' of standard, built-in modifiers and makes it easy to mix and blend them with ones you create yourself.

So the idea is that you can build anything, on the fly, by chaining together modifiers in different ways – just like building a Lego model!

Conclusion

A super simple project to get my feet wet with Elixir and the creation, inadvertently, of a new, fun, easily extensible, scripting language – ModifyChain Script!

Related Issues

open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Started
  • 0
  • 3
  • Intermediate
  • HTML
open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Started
  • 0
  • 2
  • Intermediate
  • HTML
open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Open
  • 0
  • 0
  • Intermediate
  • HTML
open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Started
  • 0
  • 1
  • Intermediate
  • HTML

Get hired!

Sign up now and apply for roles at companies that interest you.

Engineers who find a new job through Functional Works average a 15% increase in salary.

Start with GitHubStart with Stack OverflowStart with Email