This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns doc.doc-diff | |
#+clj (:require [clojure.core.typed :as t]) | |
#+cljs (:require-macros [cljs.core.typed :as t])) | |
(t/declare-datatypes 'Set-Attrs) | |
(t/declare-names 'Set-Attrs) | |
(t/declare-datatypes Set-Attrs) | |
(t/declare-names Set-Attrs) | |
(t/defalias Cmd (U Set-Attrs Set-Order Update-Child Swap-Child)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Rec [x] | |
(U '{:op (Value :if) | |
:test x | |
:then x | |
:else x} | |
'{:op (Value :var) | |
:var clojure.lang.Var} | |
'{:op (Value :nil)} | |
'{:op (Value :false)})))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hello where | |
import Data.Map as M | |
import FFI | |
data Tag = Tag [String] | |
data Attrs = Map String String | |
data Doc = Doc { tag :: Tag, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Doc = Doc { tag :: Node, order :: [Id], childs :: Map Id Doc } | |
doc__get_child :: Doc -> Id -> Doc | |
doc__get_child doc id = fromJust (Data.Map.lookup id (childs doc)) | |
doc__set_child :: Doc -> Id -> Doc -> Doc | |
doc__set_child doc id value = doc { childs = Data.Map.insert id value (childs doc) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Doc.Core where | |
import Data.Map (Map, lookup, insert) | |
import Data.Maybe (fromJust) | |
data Doc = Doc { _tag :: Node, _order :: [Id], _childs :: Map Id Doc } | |
makeLenses ''Doc | |
doc__get_child :: Doc -> Id -> Doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x@server:~$ cabal install lens | |
Resolving dependencies... | |
In order, the following would be installed: | |
parallel-3.2.0.4 (new package) | |
prelude-extras-0.4 (new package) | |
reflection-1.4 (new package) | |
transformers-0.3.0.0 (new version) | |
mtl-2.1.3.1 (new version) | |
aeson-0.7.0.6 (reinstall) changes: mtl-2.2.0.1 -> 2.1.3.1 | |
exceptions-0.6.1 (reinstall) changes: mtl-2.2.0.1 -> 2.1.3.1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun switch-to-buffer-if-exists (nm) | |
(if (get-buffer nm) | |
(switch-to-buffer nm) | |
(message (format "Buffer %s does not exist" nm)))) | |
(defun switch-to-buffer-if-exists-cmd (nm) | |
(lambda () | |
(interactive) | |
(switch-to-buffer-if-exists nm))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
catcher(N) -> | |
try generate_exception(N) of | |
Val -> {N, normal, Val} | |
catch | |
throw: X -> {N, caught, thrown, X}; | |
exit:X -> {N, caught, exited, X}; | |
error:X -> {N, caught, error, X} | |
end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.StackOverflowError | |
at clojure.lang.RT.length(RT.java:1646) | |
at clojure.lang.RT.seqToArray(RT.java:1587) | |
at clojure.lang.ASeq.toArray(ASeq.java:146) | |
at clojure.lang.RT.toArray(RT.java:1565) | |
at clojure.core$to_array.invoke(core.clj:333) | |
at clojure.core$format.doInvoke(core.clj:5178) | |
at clojure.lang.RestFn.invoke(RestFn.java:460) | |
at clojure.core$fn__5497.invoke(core_print.clj:380) | |
at clojure.lang.MultiFn.invoke(MultiFn.java:231) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling "resources/public/out/main.js" from ["cljs"]... | |
Compiling "resources/public/out/main.js" failed. | |
clojure.lang.ExceptionInfo: failed compiling file:cljs/util/reactive.cljs | |
core.clj:4327 clojure.core/ex-info | |
compiler.clj:990 cljs.compiler/compile-file | |
compiler.clj:1051 cljs.compiler/compile-root | |
closure.clj:398 cljs.closure/compile-dir | |
closure.clj:437 cljs.closure/eval2650[fn] | |
closure.clj:301 cljs.closure/eval2578[fn] | |
closure.clj:451 cljs.closure/eval2637[fn] |
OlderNewer