- アプリケーションは、オープンソースであること。オペレーションは自動であり、中央のコントロール主体を持たないこと。トークン、データ、レコード、などにつき、暗号化されて分散化されたブロックチェーンを利用していること。
- アプリケーションは、オープンに流通可能な、暗号トークンを持っていること。アプリケーションの利用に際してトークンを利用すること。参加者には、そのトークンによってリワード(報酬)が支払われること。
- アプリケーションはマーケットやユーザーからの改善要求によりプロトコルを改善していくこと。この改善は、ユーザーのコンセンサスによること。
以下 Haskell Maxims and Arrows の翻訳
私は2001年から仕事でもプライベートでもHaskellを書いてきました。仕事で書いていたのはそのうち3年のことです。これらは私が学んだことです…
- Haskellは理解すれば理解するほどきれいに書けることを約束してくれます。信頼してください
- 常にパターンを探しましょう。単純になるとき、またその時だけそれらを抽象化するのです
- 辛抱強く抽象化を正しく理解しましょう。もしそれが出来たならすべてのことが魔法のようにつじつまが合うようになるでしょう。
- 実装そのものが設計図となります
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
name: ista | |
version: 0.1.0.0 | |
build-type: Simple | |
cabal-version: >=1.10 | |
executable app | |
main-is: ista.hs | |
ghc-options: -threaded -rtsopts -with-rtsopts=-N | |
build-depends: base | |
, mwc-random |
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 RankNTypes #-} | |
module Main where | |
import Control.Monad | |
import Control.Monad.IO.Class (MonadIO, liftIO) | |
import Control.Monad.Morph (hoist, generalize) | |
import Control.Monad.State (State, StateT) | |
import qualified Control.Monad.State as State | |
import Data.List (genericLength) |
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 RankNTypes #-} | |
action :: ((forall s. s -> s) -> IO ()) -> IO () | |
action f = f id | |
f :: (forall s. s -> s) -> () | |
f _ = () | |
main = do | |
action (\x -> pure $ f x) |
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
$ curl -XPOST -d'name=Alice' -d'age=15' http://localhost:8080/person | |
Person {name = "Alice", age = 15} | |
$ curl -XPOST -d'name=Bob' -d'age=16' http://localhost:8080/person | |
Person {name = "Bob", age = 16} | |
$ curl -XPOST -d'name=Carol' -d'age=abc' http://localhost:8080/person | |
Bad Request. | |
$ curl http://localhost:8080/person |
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
{- | |
- 株データAPI | |
- http://www.orenokabu.com/apis | |
-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where |
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 OverloadedStrings #-} | |
import Control.Concurrent (threadDelay) | |
import Control.Lens | |
import Control.Monad.IO.Class (liftIO) | |
import Control.Monad.State | |
import Data.List (nub, isPrefixOf) | |
import Data.Text.Lazy.Encoding (decodeUtf8) | |
import Data.Text.Lens (unpacked) | |
import qualified Network.Wreq as Wreq |
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 OverloadedStrings #-} | |
module Main where | |
import Control.Monad (when) | |
import qualified Data.Vault.Lazy as Vault | |
import Data.ByteString.Char8 (ByteString, pack) | |
import Data.ByteString.Lazy.Char8 (fromStrict) | |
import Data.Text (Text) |
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 Data.List | |
import Data.List.Extra | |
import Data.Maybe (mapMaybe) | |
import System.Random (randomRIO) | |
import qualified Data.IntMap as IntMap | |
import Data.Foldable (for_) | |
import qualified Data.Map as Map | |
kmeans :: Ord b => (a -> a -> b) -> ([a] -> a) -> Int -> Int -> [a] -> IO [[a]] |