Ask HN: Do you accidentally flag submissions?
2 pointsby continuational1 comments
enum Option<T> {
None,
Some(T),
} fn Maybe(comptime T: type) type {
return union(enum) {
value: T,
nothing,
const Self = @This();
pub fn just(the_val: T) Self { return .{ .value = the_val }; }
pub fn nothing() Self { return .nothing; }
}
}
Over this? data Maybe a = Just a | Nothing
I'm a husband and a father of two. I've been working in Scala for over a decade, and I'm part of the founding team at Paqle.
I work on a full stack programming language called Firefly and I organize a functional programming meetup in Copenhagen:
https://www.meetup.com/moedegruppefunktionellekoebenhavnere/
It's once a month - swing by if you'd like to meet up!
meet.hn/city/55.6867243,12.5700724/Copenhagen