Skip to content

Instantly share code, notes, and snippets.

View HirotoShioi's full-sized avatar
🎯
Focusing

Hiroto Shioi HirotoShioi

🎯
Focusing
View GitHub Profile
@HirotoShioi
HirotoShioi / file0.txt
Last active June 22, 2017 14:54
Slack連携アプリ開発とES6+の便利なAPIの話 ref: http://qiita.com/zikaa/items/633977269f6615a59f8a
const { HIGH24HOUR, LOW24HOUR, PRICE, CHANGE24HOUR, FROMSYMBOL } = currency[exchange];
0x66240EEc3348B9120f6593254d642Ae19e05e6dC
@HirotoShioi
HirotoShioi / error
Last active January 7, 2018 13:54
Haskellにおける型クラス制約の役割 ref: https://qiita.com/HirotoShioi/items/5474119ba3682448c109
• No instance for (Num a) arising from a use of ‘+’
Possible fix:
add (Num a) to the context of
the type signature for:
sum' :: forall a. [a] -> a
• In the expression: x + acc
In the first argument of ‘foldl1’, namely ‘(\ x acc -> x + acc)’
In the expression: foldl1 (\ x acc -> x + acc)
|
5 | sum' = foldl1 (\x acc -> x + acc)

Keybase proof

I hereby claim:

  • I am hirotoshioi on github.
  • I am hiroto (https://keybase.io/hiroto) on keybase.
  • I have a public key ASC3N4a7Z3b00EXgRXh_9nf0-XLjTUtJyOxS7cVIhEsewgo

To claim this, I am signing this object:

@HirotoShioi
HirotoShioi / file0.txt
Last active November 7, 2019 00:31
Haskellにおける型レベルプログラミングの基本(翻訳) ref: https://qiita.com/HirotoShioi/items/39fc492401e4dcbc8cba
data Unit = MkUnit
data Bool = True | False
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import GHC.Generics
@HirotoShioi
HirotoShioi / MonadTInterpreter
Created April 6, 2018 00:52
MonadTransformers.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeApplications #-}
module Interpreter where
import Control.Monad.Except
import Control.Monad.State
import Data.Map
import qualified Data.Map as M
@HirotoShioi
HirotoShioi / file0.txt
Last active November 7, 2019 00:32
モナド変換子(その1: 基本) ref: https://qiita.com/HirotoShioi/items/8a6107434337b30ce457
someFun :: Env -> IO ()
...
someHandling :: Env -> Int -> IO Int
...
@HirotoShioi
HirotoShioi / file0.txt
Last active April 23, 2018 12:30
モナド変換子 (その3: 課題の解答) ref: https://qiita.com/HirotoShioi/items/6faaf8babb23bb2f3485
newtype App a = App (StateT UTXOs (ExcepT String Identity) a)
deriving (Functor,
, Applicative,
, Monad,
, MonadState UTXOs
, MonadError String)
@HirotoShioi
HirotoShioi / subcommand.hs
Created May 8, 2018 07:11
optparse implementation using subparser
module Main where
import Data.Semigroup ((<>))
import Options.Applicative
import Paths_opt_parse (version)
data CLI
= CollectEmails
| ProcessTicket Int