Skip to content

Instantly share code, notes, and snippets.

View lehmacdj's full-sized avatar

Devin Lehmacher lehmacdj

View GitHub Profile
@Icelandjack
Icelandjack / blog_deriving.markdown
Last active October 7, 2019 22:43
Blog Post: Derive instances of representationally equal types

Reddit discusson thread.

I made a way to get more free stuff and free stuff is good.

The current implementation of deriveVia is here, it works with all the examples here. Needs GHC 8.2 and th-desugar.

It doesn't take long

for new Haskellers to get pampered by their compiler. For the price of a line or two the compiler offers to do your job, to write uninteresting code for you (in the form of type classes) such as equality, comparison, serialization, ... in the case of 3-D vectors

Become a next-generation systems hacker with Rust

[Rust] is a novel systems programming language, designed for writing and maintaining large-scale, ultra-reliable software in the domains where typically only C and C++ are appropriate. It is the only production programming language in the world that is memory safe - meaning Rust software does not segfault - but does not have a garbage collector or rely on reference counting, and that makes it suitable for writing all kinds of software. It is also arguably the fastest programming language in the world. And with a focus on developer

@CMCDragonkai
CMCDragonkai / haskell_numeric_typeclasses.md
Last active February 23, 2022 23:44
Haskell: Numeric Typeclasses - How numbers work!

Numeric Typeclasses - How numbers work!

Numbers in Haskell are typed of course. They also exist as instances of a numeric typeclass hierarchy. I was confused with converting and working with numbers of different types, and not being sure which functions were polymorphic and could work with different numeric types. So I created a little diagram. Do note that the typeclass hierarchy of Haskell actually does somewhat follow the hierarchy of numbers in Math.