Skip to content

Instantly share code, notes, and snippets.

View liesnikov's full-sized avatar

liesnikov

View GitHub Profile
@liesnikov
liesnikov / Main.hs
Last active October 31, 2022 14:07
Reproducing a bug in unbound-generics https://github.com/lambdageek/unbound-generics/issues/50
{-# LANGUAGE DeriveAnyClass, DeriveGeneric #-}
import qualified Unbound.Generics.LocallyNameless as Unbound
import GHC.Generics (Generic)
import Control.DeepSeq (NFData, force)
type LName = Unbound.Name LTerm
data LTerm
= -- | variables `x`
@liesnikov
liesnikov / default.nix
Created June 29, 2022 17:05
Nix ghc Binary bug
let
defpkgs = builtins.fetchTarball {
# Descriptive name to make the store path easier to identify
name = "nixos-22.05.1271.babb041b716";
# Commit hash for nixos-unstable as of 2018-09-12
url = "https://releases.nixos.org/nixos/22.05-small/nixos-22.05.1271.babb041b716/nixexprs.tar.xz";
# Hash obtained using `nix-prefetch-url --unpack <url>`
sha256 = "0g8vwni83zn6kgkczrm5vwmyhl473rrs9d4k4hn5gfbgfsyv7ls8";
};
in
@liesnikov
liesnikov / destruct_fun.v
Created June 4, 2020 02:15
Tactic to do case-analysis on function return values
Ltac destruct_fun_explicit T t f :=
match goal with
| |- ?G => let Fn := fresh in
let Hn := fresh in
let En := fresh in
enough (forall x : T, G) as Hn;
[ apply Hn; exact t
| intros Fn; pose (ap := f Fn);
destruct Fn; destruct ap eqn: En; subst ap
]