Skip to content

Instantly share code, notes, and snippets.

@maikeulb
maikeulb / MACOS_CLANG_TIDY.md
Created February 26, 2022 21:17 — forked from sleepdefic1t/MACOS_CLANG_TIDY.md
brew clang-tidy on macOS
brew install llvm
ln -s "/usr/local/opt/llvm/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "/usr/local/opt/llvm/bin/clang-tidy" "/usr/local/bin/clang-tidy"

use cmake file

  find_program(CLANG_TIDY_BIN clang-tidy)
 find_program(RUN_CLANG_TIDY_BIN /usr/local/Cellar/llvm/10.0.0_3/share/clang/run-clang-tidy.py)
@maikeulb
maikeulb / MonadExs.hs
Created October 14, 2019 14:47 — forked from ygrenzinger/MonadExs.hs
Functor -> Applicative -> Monad typeclasses
-- Two datatypes
data Optional a = Some a | Empty deriving (Eq, Show)
data Or a b = A a | B b deriving (Eq, Show)
-- functor instances
instance Functor Optional where
fmap f (Some a) = Some (f a)
fmap _ Empty = Empty
instance Functor (Or a) where