pera
I am curious because Witchcraft (and related projects like Algae) can be super useful when for example you are working with complex data structures, yet I almost never see people mentioning it in this forum which makes me wonder, why not? ![]()
For those who are not familiar with this project, here is a great introduction to it by its author:
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
I want to open this thread for you all to discuss and help those who really like Ash but are still hesitant to use it in a real project. ...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
I’m posting this in response to Jose’s recent tweet (Cr. link) :
People are sleeping on Elixir for a coding harness:
Hot-code swappi...
New
Hello,
I wrote Stop My Hand, a Scattergories-like web application using Phoenix/LiveView as my learning project for Elixir (after readin...
New
AcmeScript — Writing JS hooks as if I were still using Elixir
I’ve been having fun building a little something over the last few days: Ac...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
lpil
Witchcraft is a very cool library but without a static type system I personally don’t enjoy these design patterns as much as I do in languages like Haskell. I’d love to see this alongside a statically typed Elixir
hassan
Do you have an example of such a data structure and how this would apply?
Arpple
if you not composing multiple function
most of the time just pattern matching is easier to write and understand
also agree with @lpil that without static type, these structure will be more difficult to understand at first glance
al2o3cr
Seconding @hassan’s query: are there examples of this?
The examples in the documentation mostly use numbers, which are simple to use in doctests and automatically satisfy a bunch of properties - but that obscures why a user would want to distinguish between (say) a semigroup and a monoid (since numbers always have zero).
IMO the library would get more attention if it was clearer what problems it makes easier to solve - right now, it mostly seems like using Witchcraft is a way to make Elixir look more like Haskell.
OvermindDL1
At times I do, both in using and mentioning it, lol.
I don’t really push it out hard because it’s not what most people here are familiar with, Elixir is functional’ish, but it doesn’t really follow the modern functional styles, so it doesn’t fit with ‘other’ things very cleanly.
Yeah this is the big big thing.
pera
Apologies for the delayed response, it was an intense week…
Yeah, I mean I agree that having a type checker is helpful, but I found some joy in using these sort of linguistic tools in a language that’s not (a) Haskell
When one is working for instance with recursive data types in languages where immutability is the norm (like in most functional programming languages) many ideas from category theory come very useful as they let you create sound generalizations on how to process data which can be independent from their types and also easy to compose. I would love to write an article on “categorical elixir” full of real world examples but right now I barely have the time to type this post, and besides, I would need to find a very patient reviewer as I’m likely not the right person for such task
But if you are OK with some (simple) Haskell you may like Patrick Thomson’s introductory series on Recursion Schemes.
Cheers!
doma_dev
We are currently experimenting with replacing standard stack with Witchcraft.
In our experience, it reduces boilerplate so much and allows to get straight to the point, as well as significantly increasing maintainability of the code.
Of course, we’re looking forward and intend to continue to contribute to Gleam ecosystem and we’re keeping a keen eye on purerl, but in the meantime and on “lean startup” budgets, we think that Witchcraft is a good foundation that gives us the best of both worlds.
P.S.
We found that as far as typeclasses are concerned, witchcraft strongly suggesting on putting proptests close to typeclass definitions makes us write way less nonsense than we would in Haskell.
And we wrote a lot of nonsense in Haskell over the course of our careers
Sebb
Eager to see a real world example.
I’d personally never (or only with very obvious benefits) use it my code. It’s hard enough to find Elixir-devs like it is, if you add that to your code It’ll become impossible (… or maybe I’m wrong and you attract all the geniuses…?)
doma_dev
Here are three examples from the devops engineering project we’re currently working on:
Any time you write
Enum.mapfollowed byEnum.into, you should instead usemapfromWitchcraft.Sometimes, you need to pipe into second argument of a binary function, having
flipis convenient.Sometimes, you work with a macro that wants to have a single
do-block. Havingfixat hand is convenient for easy implementaiton of anonymous recursion.The first real world example is enough of a reason, according to you, to use Witchcraft!
Regarding hiring: I feel like we’re in the market for different kind of Elixir developers than most, but I wouldn’t label them as “geniuses”. It’s just a matter of taste in engineering and a matter of skill in different methodologies of building systems. Most of us are coming to Elixir from Haskell, which, arguably, harbours less “genius” people, as instead of working out everything oneself, Haskellers heavily rely on their compiler to aid them in figuring out what does make sense and what doesn’t. But I think it’s really not on-topic here. Witchcraft is practical and should be used by everyone in one capacity or another.
Sebb
map,flipandfixare handy, but I can live withintoandthen.What I find intimidating and interesting about witchcraft is more this stuff: