
CommunityNews
Phantom Types in Gleam
In this post we’re going to be looking at a more advanced use of Gleam’s type system, known as phantom types. Hopefully by the end of this you’ll have another tool in your belt to help you better model data in your programs. And fear not, because many languages support phantom types (most common functional programming languages support them, but so do others like Rust, and TypeScript, and even PHP) so you can apply this knowledge elsewhere!
Before we get stuck into some examples, let’s tackle the obvious question…
https://blog.pd-andy.dev/phantom-types-in-gleam
This thread was posted by one of our members via one of our news source trackers.
First Post!

bot
Corresponding tweet for this thread:
Share link for this tweet.
Popular Backend topics

Shayne gave this excellent talk the other day on Gleam, so I thought I’d share it.
From my point of view it was really interesting to se...
New

There are 3 main formatters for Erlang which you can use from the command-line,
rebar3_format,
Steamroller
elmfmt.
Visual Studio Cod...
New

Is Zig the Long Awaited C Replacement.
Comparison with previous C contenders such as C++, D, Java, C#, Go, Rust and Swift
https://erik...
New

Ten years without Elixir.
I never got into Elixir, largely because it looked like Ruby. I was a Rubyist for a good while, spent time and...
New

Just wrote a short post, more a memo to myself, but maybe someone find it useful :stuck_out_tongue:
https://dwarfte.ch/2021/02/03/giving...
New

Go is not an easy programming language. It is simple in many ways: the syntax is simple, most of the semantics are simple. But a language...
New

Tej Pochiraju joins the mix to discuss Progressive Web Apps and how you can support them using Elixir and Phoenix to control IoT devices....
New

I describe how we use Hot Reloading with Webpack to develop faster and show how to integrate Webpack 5, webpack-dev-server, and Phoenix f...
New

Hi there!
Recently I was playing around with extracting and updating data in the DB and for fun challenged myself to try to implement a ...
New

The Ruby ecosystem is rich with tools that make us developers more productive at what we do. Both Rails and Sinatra have been used to bui...
New
Other popular topics

Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it.
Does your monitor have eye p...
New

I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New

Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New

Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New

Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New

A Hero’s Journey
with Chris Pine
@chrispine
Chris Pine, author of Learn to Program, Third Edition, discusses his journey to beco...
New

Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New

If you want a quick and easy way to block any website on your Mac using Little Snitch simply…
File > New Rule:
And select Deny, O...
New

If you’re getting errors like this:
psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New

This is cool!
DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON
We just witnessed something incredible: the largest open-s...
New
Latest in Blogs/Talks
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /react-native
- /textmate
- /sublime-text
- /kubuntu
- /arch-linux
- /revery
- /ubuntu
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim