Skip to content

Instantly share code, notes, and snippets.

🐫
🐫.P(🐫) → ∅ ≡ (∃🐫.P(🐫)) → ∅

Yuriy Pitomets Pitometsu

🐫
🐫.P(🐫) → ∅ ≡ (∃🐫.P(🐫)) → ∅
  • Ukraine
Block or report user

Report or block Pitometsu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Pitometsu
Pitometsu / depth.ml
Last active Aug 15, 2019
First-class modules sub-typing
View depth.ml
module type C = sig type 'a t = [>`C|`D] as 'a end
module type D = sig include C with type 'a t = [>`D] as 'a end
module rec C : C = C;;
module rec D : D = D;;
type c_t = (module C);;
type d_t = (module D);;
(fun (m : c_t) -> (m :> d_t)) (module C);;
- : d_t = <module>
@Pitometsu
Pitometsu / m.ml
Created Aug 13, 2019
Pass module's existential type to universal argument
View m.ml
module type S = sig
type t
val of_string : string -> t
val to_string : t -> string
end
let deser : 'a. (module S with type t = 'a) -> (_ -> 'a) * _ = fun m ->
let module M = (val m) in
@Pitometsu
Pitometsu / constraint.ml
Created Jul 29, 2019
question about constraint syntax
View constraint.ml
utop # type t = unit -> (string, string, 'a) Map.t option constraint 'a = String.comparator_witness;;
type t = unit -> (string, string, String.comparator_witness) Map.t option
utop # let f : 'a. unit -> (string, string, 'a) Map.t option constraint 'a = String.comparator_witness = fun () -> failwith "hello";;
Error: Syntax error
utop # let f : unit -> (string, string, 'a) Map.t option constraint 'a = String.comparator_witness = fun () -> failwith "hello";;
Error: Syntax error
@Pitometsu
Pitometsu / imagex.nix
Last active Jul 21, 2019
Nix /home to docker installation problem
View imagex.nix
mypkg = mkDerivation rec {
name = "mypkg";
version = "0.0.1";
src = ./.;
# ...
outputs = [ "out" "custom" ];
installPhase = ''
mkdir -p $out
do-some-install-to $out
mkdir -pv $custom/share
@Pitometsu
Pitometsu / configure
Created Jul 10, 2019
https://github.com/jhjourdan/ocaml/archive/memprof_4.05.0.tar.gz | configure flags: -prefix /nix/store/r93bflfbwbx0azzpb31dydlc0ibqxvlx-ocaml+flambda+spacetime-4.05.0 -x11lib /nix/store/3fqq1jb9acjlidhs34h2llsic31xh6r2-x11env/lib -x11include /nix/store/3fqq1jb9acjlidhs34h2llsic31xh6r2-x11env/include -flambda -with-debug-runtime --statmemprof -w…
View configure
In file included from caml/custom.h:23:0,
from minor_gc.c:19:
minor_gc.c: In function 'alloc_shr_minor':
minor_gc.c:189:54: error: 'old_header' undeclared (first use in this function); did you mean 'Make_header'?
CAML_ALLOC_EFFECT_NONE, Profinfo_hd(old_header));
^
caml/mlvalues.h:120:40: note: in definition of macro 'Profinfo_hd'
#define Profinfo_hd(hd) (((mlsize_t) ((hd) >> PROFINFO_SHIFT)) & PROFINFO_MASK)
^~
minor_gc.c:189:54: note: each undeclared identifier is reported only once for each function it appears in
@Pitometsu
Pitometsu / config.nix
Created Jul 8, 2019
~/.config/nixpkgs/
View config.nix
with import <nixpkgs> {};
{
packageOverrides = pkgs: with pkgs; {
nixUnstable = nixUnstable.overrideAttrs (attrs: {
src = fetchFromGitHub {
owner = "yorickvP";
repo = "nix";
rev = "dd7a21d40f8f649f2274a03e5cbdeb248796d5c8";
sha256 = "0wwmxxqbqkrf9wgg6vif6djxmzbr5sfy2hisf5qdksn2j4817sml";
@Pitometsu
Pitometsu / 10-slimblade.conf
Last active Jul 8, 2019
/usr/share/X11/xorg.conf.d/
View 10-slimblade.conf
Section "InputClass"
Identifier "Kensington Slimblade Trackball"
MatchProduct "Kensington Slimblade Trackball"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
# Option "ButtonMapping" "1 8 2 4 5 6 7 3 2"
Option "ScrollButton" "8"
Option "ScrollMethod" "button"
# Option "MiddleEmulation" "on"
@Pitometsu
Pitometsu / config.nix
Last active Jul 7, 2019
~/.config/nixpkgs/
View config.nix
with import <nixpkgs> {};
{
packageOverrides = pkgs: with pkgs; {
nix = nix.overrideAttrs (attrs: {
src = fetchFromGitHub {
owner = "yorickvP";
repo = "nix";
rev = "dd7a21d40f8f649f2274a03e5cbdeb248796d5c8";
sha256 = "0wwmxxqbqkrf9wgg6vif6djxmzbr5sfy2hisf5qdksn2j4817sml";
@Pitometsu
Pitometsu / TODO.txt
Last active Jul 8, 2019
user-dev-env
View TODO.txt
- nox?
- nix
- home-manager/homesick
- gpg2
- git-secret/git-crypt/blackbox/yadm
- niv?
- nixos-shell (https://github.com/Mic92/nixos-shell)
- pass?
@Pitometsu
Pitometsu / output.txt
Created Jul 4, 2019
nix-build requireFile problem (2Gb)
View output.txt
building '/nix/store/mv3a1na7c9izd0yn4iz1y9x82rv9avx5-_opam.drv'...
***
Unfortunately, we cannot download file _opam automatically.
Please go to /path/to/_opam to download it yourself, and add it to the Nix store
using either
nix-store --add-fixed sha256 _opam
or
nix-prefetch-url --type sha256 file:///path/to/_opam
You can’t perform that action at this time.