Skip to content

Instantly share code, notes, and snippets.

View Konrad1991's full-sized avatar

Konrad Konrad1991

View GitHub Profile
@Konrad1991
Konrad1991 / OOP_F2003_Part_1.md
Created December 20, 2022 14:35 — forked from n-s-k/OOP_F2003_Part_1.md
Object-Oriented Programming in Fortran 2003 Part 1: Code Reusability
@Konrad1991
Konrad1991 / borrow.cpp
Created October 12, 2022 06:29 — forked from foonathan/borrow.cpp
Quick'n'dirty implementation of Rust's borrow checker for a C++Now Lightning Talk - not supposed to be used
#include <iostream>
#include "borrow_checker.hpp"
int main()
{
auto i = 42;
// borrow `i` under name `ref`
borrow_var(ref, i)
@Konrad1991
Konrad1991 / AD.hs
Created October 12, 2022 06:28 — forked from ttesmer/AD.hs
Automatic Differentiation in 38 lines of Haskell using Operator Overloading and Dual Numbers. Inspired by conal.net/papers/beautiful-differentiation
{-# LANGUAGE TypeSynonymInstances #-}
data Dual d = D Float d deriving Show
type Float' = Float
diff :: (Dual Float' -> Dual Float') -> Float -> Float'
diff f x = y'
where D y y' = f (D x 1)
class VectorSpace v where
zero :: v