Skip to content

Instantly share code, notes, and snippets.

View nakaakist's full-sized avatar

Nariyuki Saito nakaakist

  • PLAID, Inc. / RightTouch, Inc.
  • Tokyo
  • X @nakaakist
View GitHub Profile
@mpppk
mpppk / clean_architecture.md
Last active July 22, 2024 06:48
クリーンアーキテクチャ完全に理解した

2020/5/31追記: 自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。

このドキュメントを完成させるために、今後以下のような更新を予定しています。

  • TODO部分を埋める
  • 書籍を基にした理論・原則パートと、実装例パートを分割
    • 現在は4層のレイヤそれぞれごとに原則の確認→実装時の課題リスト→実装例という構成ですが、同じリポジトリへの言及箇所がバラバラになってしまう問題がありました。更新後は、実装時の課題リストを全て洗い出した後にまとめて実装を確認する構成とする予定です。

2021/1/22追記:

@yamaguchiyuto
yamaguchiyuto / btree.hs
Last active June 27, 2024 18:51
Haskell B-tree implementation
data Tree a = Nil Int | Leaf Int [a] | Node Int [a] [Tree a] deriving Show
find :: (Ord a, Eq a) => Tree a -> a -> Bool
find (Nil _) _ = False
find (Leaf _ []) _ = False
find (Leaf m (k:ks)) x
| x == k = True
| x < k = False
| x > k = find (Leaf m ks) x
find (Node _ [] (t:ts)) x = find t x
@mtesseract
mtesseract / haskell-records.md
Last active March 8, 2023 22:25
Working around Haskell's namespace problem for records

The Problem

Defining records in Haskell causes accessor functions for the record's fields to be defined. There is no seperate namespace for these accessor functions.

The Goal

Be able to

  • use records in Haskell, which share field names.
  • use lenses for accessing these fields