Skip to content

Instantly share code, notes, and snippets.

View zindel's full-sized avatar

Oleksiy Golovko zindel

  • Prague, The Czech Republic
View GitHub Profile
module P93 where
data Expr = Operator Op
| Value Rational
deriving (Show, Eq)
data Op = Plus | Minus | Mul | Div deriving (Show, Eq, Enum, Bounded)
puzzle nums = [s1 ++ " = " ++ s2
| (p1, p2) <- split nums
diff --git a/Arrow/Arrow.ml b/Arrow/Arrow.ml
index d0860d4..21c72a5 100644
--- a/Arrow/Arrow.ml
+++ b/Arrow/Arrow.ml
@@ -1,3 +1,5 @@
+module StringSet = Set.Make(String)
+
module type ACTION = sig
type 'a t
@zindel
zindel / Arrow.ml
Last active November 8, 2018 16:39
module StringSet = Set.Make(String)
module type ACTION = sig
type 'a t
val execute : 'a t -> 'a
end
module type CACHE = sig
type key = string list
module Action : sig
type _ t
val execute : 'a t -> 'a
val readFile : string -> string t
val writeFile : string -> string -> unit t
end = struct
type _ t =
@zindel
zindel / Arrow.ml
Last active November 6, 2018 21:41
module type TRACK = sig
type 'a t
end
module Track : TRACK = struct
type 'a t = Let of string * 'a t | Do of ('a t -> 'a t)
end
@zindel
zindel / Arrow.ml
Last active November 6, 2018 12:43
module StringMap = Map.Make (String)
module type MONAD = sig
type 'a t
val bind : 'a t -> f:('a -> 'b t) -> 'b t
val return : 'a -> 'a t
module Let_syntax : sig
module StringMap = Map.Make (String)
(* File system path. *)
module Path = struct
type t = string
end
module type ACTION = sig
type 'v t
@zindel
zindel / Arrow.re
Last active November 2, 2018 16:55
module Action = {
type t('i, 'o) = 'i => 'o;
let chain = (action1, action2, arg) => arg |> action1 |> action2;
};
module Rule = {
type t('i, 'o) = {
action: Action.t('i, 'o),
f: option(unit),
let%lwt (emitted_modules, size) =
Lwt_io.with_file(
~mode=Lwt_io.Output,
~perm=0o777,
~flags=Unix.[O_CREAT, O_TRUNC, O_WRONLY, O_SHARE_DELETE, O_SYNC, O_NONBLOCK],
temp_file,
run(start_time, ctx),
);
Logs.debug(x => x("Before RENAME --- %s", temp_file));
#!/bin/sh
node_modules/.bin/fpack serve \
--dev \
--mock path:path-browserify \
--preprocess='^src/.+\.js$' \
--preprocess='\.md$:raw-loader' \
--preprocess='\.(svg|png)$:url-loader' \
--preprocess='\.less$:style-loader!css-loader!less-loader?javascriptEnabled=true' \
--preprocess='\.css$:style-loader!css-loader?importLoaders=1!postcss-loader?path=postcss.config.js' \
--preprocess='\.(ttf|woff|woff2|eot)$:file-loader?name=static/media/[name].[hash:8].[ext]&publicPath=http://localhost:3000/' \