go-extlib

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2023 License: MIT

README

ExtLib Logo ExtLib Gopher Mascot

⚠️ Note: This is still an experiment. Go Reference Build Badge

Motivation

My main motivation was to try out generics in Go. I jumped straight into the usual suspects: Filter and Map. When testing these, I saw the need for assertion functions: another opportunity to exercise some more generics! It is now part of this ext-lib under lives as an testing/assert.

Later I thought it would be nice to implement Set, and then HashMap, with which I got carried away and ended up implementing a somewhat naïve hasher (you can read more on the rationale on this commit).

When I realized, I was already having fun with Maybe, Either and Result. Here is where I stumbled upon some limitations of Go generics. Right when I was experimenting with it, I came across a blog post by @hypirion titled "Type-Safe HTTP Servers in Go via Generics" where the author bumps into these same limitations.

When writing software in Go, I've always wanted slightly higher level constructs, especially to represent business domain concepts. Some may say I haven't fully embraced Go. Perhaps I haven't 🤷. But I sure know people who'd also like to go up in abstraction a tad bit.

Hope this is enough motivation… 😅

⚠️ As the note above says, this is an experiment and no attention was paid to performance or allocations.

The ExtLib

🚧 This section is a work in progress.


Gopher: gopherize.me

Directories

Path Synopsis
internal
testing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL