Skip to content

Instantly share code, notes, and snippets.

module FoldTogether where
import Prelude
import Data.Foldable
import Data.Array
import Data.Array.NonEmpty as N
import Control.Bind
chunksOf_ n [] = []
[ 42%] Built target unicode
[ 43%] Linking CXX static library libcrispy-core.a
ar: no archive members specified
usage: ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
/Users/lumie/tmp/contour/3rdparty/libunicode/src/unicode/ucd.cpp:23766:43: error: wrong number of template arguments (1, should be 2)
23766 | auto constexpr Emoji = std::array<Interval>{ // {{{
| ^
In file included from /Users/lumie/tmp/contour/3rdparty/libunicode/src/unicode/ucd.h:16,
from /Users/lumie/tmp/contour/3rdparty/libunicode/src/unicode/ucd.cpp:15:
/usr/local/Cellar/gcc/9.3.0_1/include/c++/9.3.0/array:94:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
94 | struct array
| ^~~~~
make[2]: *** [3rdparty/libunicode/src/unicode/CMakeFiles/unicode.dir/ucd.cpp.o] Error 1
make[1]: *** [3rdparty/libunicode/src/unicode/CMakeFiles/unicode.dir/all] Error 2
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 309a0ee..fc4b8a0 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,10 +1,12 @@
find_package(PkgConfig REQUIRED)
find_package(Freetype REQUIRED)
+find_package(fontconfig REQUIRED)
pkg_check_modules(harfbuzz REQUIRED IMPORTED_TARGET harfbuzz)
-- Configuring done
CMake Error at test/CMakeLists.txt:17 (add_executable):
Target "hb-inspect" links to target "PkgConfig::fontconfig" but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an AL ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:223:64: note: candidate function template not viable: requires 1 argument, but 601 were
provided
/Users/lumie/tmp/contour/3rdparty/libunicode/src/unicode/ucd.cpp:3075:42: error: no viable constructor or deduction guide for deduction of template arguments of 'array'
auto constexpr Changes_When_Titlecased = std::array{ // {{{
^
(defn terp [mem ip]
(let [[op a b o] (subvec mem ip)]
(if (not= op 99)
(recur
(assoc mem o ((case op 1 + 2 *) (mem a) (mem b)))
(+ ip 4))
mem))))
(def mem (vec (read-string (str "[" (slurp "data/day2-input.txt") "]"))))
(ns advent_of_code_2019.day1)
(comment
(let [masses (vec (read-string (str "[" (slurp "data/day1-input.txt") "]")))
fuel-req #(- (quot % 3) 2)
total-fuel #(transduce % + masses)]
[;; part 1
(total-fuel (map fuel-req))
;; part 2
(total-fuel (mapcat (comp #(take-while pos? %) rest #(iterate fuel-req %))))]))
(s/def ::rock-paper-scissors #{:rock :paper :scissors})
(s/def ::beats (s/map-of ::rock-paper-scissors ::rock-paper-scissors)
import Control.Arrow
import Data.List
data Category = Ones | Twos | Threes | Fours | Fives | Sixes | FullHouse
| FourOfAKind | LittleStraight | BigStraight | Choice | Yacht
deriving (Enum, Eq, Ord, Show)
allEqual [] = True
allEqual (c:cs) = all (==c) cs