Skip to content

Instantly share code, notes, and snippets.

View Pitometsu's full-sized avatar
🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅

Yuriy Pitomets Pitometsu

🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅
View GitHub Profile
@Pitometsu
Pitometsu / cc-overlay.nix
Created September 13, 2019 05:58
How to override CC by Nix overlay?
(self: super:
let
# gcc = super.pkgs.gcc8;
# gcc8 = super.pkgs.gcc8.override { stdenv = super.stdenv; };
stdenv = super.stdenvAdapters.overrideCC super.stdenv super.pkgs.gcc8;
in
{
inherit stdenv; # gcc8 gcc;
# stdenv = super.overrideCC super.stdenv self.pkgs.gcc;
# gcc8 = super.gcc8.override { stdenv = super.stdenv; };
@Pitometsu
Pitometsu / .Xresources
Last active July 4, 2021 00:44
dotfiles
Xcursor.theme: ATER
! UI elements
Emacs.menuBar: 0
Emacs.toolBar: 0
Emacs.verticalScrollBars: off
! Font settings
Emacs.FontBackend: xft,x
Emacs.font: Inconsolata LGC-8.6
  • Algorithm Design with Haskell
  • Beginning Haskell: A Project-Based Approach
  • Developing Web Apps with Haskell and Yesod
  • Functional Design and Architecture
  • Get Programming with Haskell
  • Haskell Book
  • Haskell Cookbook
  • Haskell Data Analysis Cookbook
  • Haskell Design Patterns
  • Haskell from the Very Beginning
@Pitometsu
Pitometsu / Term.java
Created May 19, 2020 21:09 — forked from jbgi/Term.java
Generalized Algebraic Data Types (GADT) in Java
import static java.lang.System.*;
import java.util.function.BiFunction;
import java.util.function.Function;
// Implementation of a pseudo-GADT in Java, translating the examples from
// http://www.cs.ox.ac.uk/ralf.hinze/publications/With.pdf
// The technique presented below is, in fact, just an encoding of a normal Algebraic Data Type
// using a variation of the visitor pattern + the application of the Yoneda lemma to make it
// isomorphic to the targeted 'GADT'.
@Pitometsu
Pitometsu / appfuncr.swift
Last active May 13, 2020 03:26
Applicative functor in swift for (->)r type
// lets define Applicative Functor for (->)r type (function of function)
// tip: similar to Reader monad.
infix operator <*> { associativity left precedence 150 }
func <*> <A, B, C> (f : A -> B -> C, g : A -> B)(x : A) -> C {
return f (x) (g(x))
}
infix operator <|> { associativity left precedence 150 }
func <|> <A, B, C> (f : A -> B -> C, g : C -> A) -> C -> B -> C {
return pure(f) <*> g
@Pitometsu
Pitometsu / layout0.json
Last active May 6, 2020 09:32
Crysalis keyboard layout for keyboardio
{
"keymap": [
{
"keyCode": 30,
"label": "1",
"extraLabel": "!"
},
{
"keyCode": 31,
"label": "2",
@Pitometsu
Pitometsu / layout0.json
Last active March 27, 2020 11:17
Chrysalis keyboardio layouts
{
"keymap": [
{
"keyCode": 2079,
"label": "@"
},
{
"keyCode": 2078,
"label": "!"
},
@Pitometsu
Pitometsu / constraints.hs
Created March 13, 2020 20:50
constraints family
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE PolyKinds #-}
import Data.Kind (Constraint)
type family All (c :: k -> Constraint) ts :: Constraint where All c '[] = (); All c (t:ts) = (c t, All c ts)
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE UnicodeSyntax #-}
@Pitometsu
Pitometsu / TODO.txt
Last active January 11, 2020 09:26
user-dev-env
- nox?
- nix
- home-manager/homesick
- gpg2
- git-secret/git-crypt/blackbox/yadm
- niv?
- nixos-shell (https://github.com/Mic92/nixos-shell)
- pass?