Skip to content

Instantly share code, notes, and snippets.

View matonix's full-sized avatar
🍜
On ramening

maton matonix

🍜
On ramening
View GitHub Profile
@matonix
matonix / DPGen.hs
Last active April 4, 2021 11:54
An interpreter generating a DP array from a recurrence relation.
{-# LANGUAGE LambdaCase #-}
module DPGen where
import Data.Array
import Data.Array.ST.Safe
( newListArray, readArray, writeArray, runSTArray, MArray )
import Data.Function
import Data.List
(* 元論文 https://www2.math.su.se/reports/2001/11/ *)
(* 元記事 https://qiita.com/lotz/items/60c20189f931dd8e5e9f *)
(*
* Ring の構造を真似て作る ?
* https://coq.inria.fr/distrib/8.5beta3/stdlib/Coq.setoid_ring.Ring.html#
* https://coq.inria.fr/distrib/8.5beta3/stdlib/Coq.setoid_ring.Ring_theory.html#
*)
(* 可換モノイド https://github.com/palmskog/monoid-ssreflect *)

並行並列Haskell 4節 Floyd-Warshall アルゴリズム実行ログ

直列版

$ cabal exec fwsparse -- 1000 800 +RTS -s -N1 -l
552434
   5,700,238,648 bytes allocated in the heap
     188,155,200 bytes copied during GC
         521,336 bytes maximum residency (107 sample(s))
@matonix
matonix / haskell.json
Created May 3, 2020 09:37
VSCode User Snippet for Haskell (AtCoder)
{
// Imports
"Import ByteString Char8": {
"prefix": "imbs",
"body": [
"import qualified Data.ByteString.Char8 as BS",
],
"description": "Import BS"
},
"Import Vector Unboxed": {
@matonix
matonix / Labelled-edges of algebraic-graphs.md
Created October 10, 2019 02:17
Labelled-edges についての質問に答えたので自分用にメモ.

Thinking with Types 読書会

演習 1.4-i

指数法則 a^b × a^c = a^(b+c) を型を使って示せ

to :: (b -> a, c -> a) -> Either b c -> a
from :: (Either b c -> a) -> (b -> a, c -> a)
@matonix
matonix / Syaku.hs
Last active April 29, 2019 03:02
高階しゃくとり法関数
module Syaku where
import Debug.Trace
-- | 参考文献: https://qiita.com/drken/items/ecd1a472d3a0e7db8dce
-- | 参考にした関数
-- mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
-- mapAccumL f s t = runStateL (traverse (StateL . flip f) t) s
{-# START_FILE package.yaml #-}
name: {{name}}
version: '0.1.0'
category: {{category}}{{^category}}Web{{/category}}
author: {{author-name}}{{^author-name}}Author name here{{/author-name}}
maintainer: {{author-email}}{{^author-email}}example@example.com{{/author-email}}
copyright: {{copyright}}{{^copyright}}{{year}}{{^year}}2017{{/year}} {{author-name}}{{^author-name}}Author name here{{/author-name}}{{/copyright}}
license: BSD3
github: {{github-username}}{{^github-username}}githubuser{{/github-username}}/{{name}}
@matonix
matonix / mattermost_solarized_light.json
Last active July 20, 2018 02:01 — forked from seventyeight/mattermost_solarized_light.json
Mattermost theme solarized light
{
"awayIndicator": "#e0b333",
"buttonBg": "#859900",
"buttonColor": "#586e75",
"centerChannelBg": "#fdf6e3",
"centerChannelColor": "#839496",
"codeTheme": "solarized-light",
"linkColor": "#268bd2",
"mentionBj": "#dc322f",
"mentionColor": "#ffffff",
@matonix
matonix / .tmux.conf
Created April 12, 2018 03:12
.byobu settings
# ペインボーダーの色を設定する
set -g pane-border-fg black
set -g pane-border-bg default
# アクティブなペインを目立たせる
set -g pane-active-border-fg blue
set -g pane-active-border-bg default
# マウス操作をアクティブにする
set -g mouse on
set -g mouse-utf8 on
set -g mouse-select-pane on