import Data.Functor.Yoneda
import Data.Char
import Data.Kind
infixr 5
·
type List :: (Type -> Type) -> Constraint
class List f where
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
著者: 青い鴉(ぶるくろ)さん @bluecrow2
これは結城浩さんの運用されていた YukiWiki に当時 Coffee 様 (青い鴉(ぶるくろ)さん)がかかれていた文章です。 ただ 2018 年 3 月 7 日に YukiWiki が運用停止したため消えてしまいました。その記事のバックアップです。
今は 404 ですが、もともとの記事の URL は http://www.hyuki.com/yukiwiki/wiki.cgi?%A5%C7%A5%B9%A5%DE%A1%BC%A5%C1%A4%AC%B5%AF%A4%AD%A4%EB%CD%FD%CD%B3 になります。
昔、自分がとても感銘を受けた文章なので、このまま読めなくなるのはとてももったいないと思い、バックアップとして公開しています。
※図は Mastering Bitcoin (PDF) からの引用
- ビットコインウォレットの残高は、ビットコインネットワークから自分のビットコインアドレスが output になっているトランザクションの情報 UTXO (Unspent Transaction Output) を集めて金額を合計したもの
- ビットコインで支払うぞってなったら、集めて使おうとしてる UTXO が本当にまだ使われてないかをチェックする必要がある
- UTXO が使われていないかどうかの検証は、そのトランザクションより下の全てのブロックに含まれる全てのトランザクションをチェックする
- 全部集めるにはブロックチェーン全部をダウンロードして探索しないといけない?
This file contains hidden or 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
import com.twitter.util.Future | |
import scala.reflect.ClassTag | |
// generated code | |
case class FooReqThrift(value: Int) | |
case class ThriftException(message: String, cause: Throwable) extends RuntimeException(message, cause) | |
// libs | |
abstract class RequestAdapter[ReqThrift, ReqDto] { | |
def adapt(a: ReqThrift): Future[ReqDto] |
This file contains hidden or 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
package scalaworld.macros | |
package com.folio.account.macros | |
import scala.collection.immutable.Seq | |
import scala.meta._ | |
/** | |
* annotation for case class. | |
* |
This file contains hidden or 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
{-# LANGUAGE TemplateHaskell #-} | |
-- | For when you have a record that doesn't have lenses derived for | |
-- it and you need a lens, just use @$(lens 'thefield)@ and away you go. | |
module Control.Lens.FieldTH where | |
import Language.Haskell.TH | |
lens :: Name -> Q Exp | |
lens name = do | |
[|\f r -> | |
fmap | |
$(lamE |
This file contains hidden or 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
-- Deep Learning from Scratch | |
-- Chapter 01 | |
module Ch01.Main where | |
import Prelude hiding (lookup) | |
import Control.Monad | |
main :: IO () | |
main = do | |
-- 算術計算 |
This file contains hidden or 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
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE RecordWildCards #-} | |
import Control.Comonad | |
import Control.Comonad.Cofree | |
import Control.Monad | |
import Control.Monad.ST |
This file contains hidden or 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
#!/usr/bin/env stack | |
-- stack --install-ghc runghc --package turtle | |
import Turtle | |
main = hostname >>= echo |