Skip to content

Instantly share code, notes, and snippets.

View Kakadu's full-sized avatar

Dmitrii Kosarev Kakadu

  • (ex-)JetBrains Research
  • Saint-Petersburg, Russia
View GitHub Profile
✗ CMAKE_MODULE_PATH=/home/kakadu/prog/qt/qt_off/6.0.1/gcc_64/lib/cmake/ cmake --find-package -DNAME="Qt6" -DCOMPILER_ID=GNU -DMODE=EXIST -DLANGUAGE=CXX
CMake Error at /usr/share/cmake-3.16/Modules/FindThreads.cmake:49 (message):
FindThreads only works if either C or CXX language is enabled
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/home/kakadu/prog/qt/qt_off/6.0.1/gcc_64/lib/cmake/Qt6/Qt6Dependencies.cmake:41 (find_dependency)
/home/kakadu/prog/qt/qt_off/6.0.1/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:76 (include)
/usr/share/cmake-3.16/Modules/CMakeFindPackageMode.cmake:183 (find_package)
@Kakadu
Kakadu / or.scala
Created January 25, 2021 23:06
Scala 2 with or type
sealed trait AST
case class ConstInt(x: Int) extends AST
case class ConstDouble(x: Double) extends AST
case class SomethingElse() extends AST
type ¬[A] = A => Nothing
type ∨[T, U] = ¬[¬[T] with ¬[U]]
type ¬¬[A] = ¬[¬[A]]
type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) }
@Kakadu
Kakadu / merlin.log.json
Created January 13, 2021 16:20
Testing camlp5 with merlin
# 0.03 New_merlin - run
changed directory to "/media/oldhome/kakadu/prog/asp/camlp5_pp_demo"
# 0.03 Mconfig - normalize
{
"ocaml": {
"include_dirs": [],
"no_std_include": false,
"unsafe": false,
"classic": false,
"principal": false,
@Kakadu
Kakadu / dune
Created January 12, 2021 16:25
demo with camlp5 rewriter for OCaml
(env
(dev
(flags (:standard -rectypes -warn-error -A -w -33))
))
(library
(name lib1)
(modules lib1)
(preprocess (action
(run %{project_root}/rewriter.exe %{input-file})))
@Kakadu
Kakadu / log.txt
Created January 3, 2021 23:44
camlp5 + odoc
➜ camlp5_odoc_demo git:(master) dune build @doc --verbose
Workspace root: /media/oldhome/kakadu/prog/asp/camlp5_odoc_demo
Running[0]: /usr/bin/nproc > /tmp/dune8bd514.output 2> /dev/null
Auto-detected concurrency: 4
disable binary cache
Running[1]: /home/kakadu/.opam/4.10.1+fp+flambda/bin/ocamlc.opt -config > /tmp/dune59e34e.output
Dune context:
{ name = "default"
; kind = "default"
; profile = Dyn
@Kakadu
Kakadu / fix.ml
Created November 8, 2020 10:59
ocaml angstrom mutual recursion
open Angstrom
let rec fix_comb f a = f (fix_comb f) a
(* http://okmij.org/ftp/Computation/fixed-point-combinators.html#Poly-variadic *)
let fix_poly :
(('a -> 'b) list -> 'a -> 'b) list -> ('a -> 'b) list =
fun l ->
fix_comb
(fun self l -> List.map (fun li x -> li (self l) x) l)
@Kakadu
Kakadu / obj.ml
Created October 29, 2020 18:50
ocaml error Type char/2 is not compatible with type char/2312
module Types : sig
type ('a, 'b) tag = Parsed of 'a * 'b option | Failed of 'b option
type ('stream, 'parsed, 'error) result = ('parsed * 'stream, 'error) tag
val bind : ('stream, 'parsed, 'error) result -> ('parsed -> [`Ok of 'parsed' | `Fail of 'error]) -> ('stream, 'parsed', 'error) result
end = struct
type ('a, 'b) tag = Parsed of 'a * 'b option | Failed of 'b option
type ('stream, 'parsed, 'error) result = ('parsed * 'stream, 'error) tag
let bind _ _ = assert false
@Kakadu
Kakadu / a.ml
Created September 17, 2020 17:49
bad highlighting example
module TwoNilList = struct
open Helper
open OCanren
module L = struct
type ('a, 'self) t = Nil | Nil2 | Cons of 'a * 'self
[@@deriving gt ~options:{show; fmt; gmap}]
type 'a ground = ('a, 'a ground) t
[@@deriving gt ~options:{show;fmt; gmap}]
type 'a logic = ('a, 'a logic) t OCanren.logic
@Kakadu
Kakadu / cps.fs
Created August 24, 2020 07:35
cps vs non cps
module Tour.Functions
type tree = Leaf | Node of tree * tree
let rec make depth =
if depth <= 0 then Leaf
else
let r = make (depth - 1) in
let l = if depth % 100000 = 0 then r else Leaf in
@Kakadu
Kakadu / log.txt
Last active August 18, 2020 09:59
dune, ppx and not -linkall flag
➜ gt-ppx git:(dune8-about-as) кь
➜ gt-ppx git:(dune8-about-as) rm -fr _build/default/.ppx
➜ gt-ppx git:(dune8-about-as) dune build regression/test822.exe --verbose
Workspace root: /media/oldhome/kakadu/prog/asp/gt-ppx
Running[0]: /usr/bin/nproc > /tmp/dune44ca62.output 2> /dev/null
Auto-detected concurrency: 4
disable binary cache
Running[1]: /home/kakadu/.opam/4.10.0+fp+flambda/bin/ocamlc.opt -config > /tmp/dune328a0c.output
Dune context:
{ name = "default"