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
View file0.txt
const { HIGH24HOUR, LOW24HOUR, PRICE, CHANGE24HOUR, FROMSYMBOL } = currency[exchange];
@HirotoShioi
HirotoShioi / error
Last active January 7, 2018 13:54
Haskellにおける型クラス制約の役割 ref: https://qiita.com/HirotoShioi/items/5474119ba3682448c109
View error
• 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)
View keybase.md

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
View file0.txt
data Unit = MkUnit
data Bool = True | False
View gist:180c70fd29335bf6d43d1b2cb414395a
{-# 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
View MonadTInterpreter
{-# 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
View file0.txt
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
View file0.txt
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
View subcommand.hs
module Main where
import Data.Semigroup ((<>))
import Options.Applicative
import Paths_opt_parse (version)
data CLI
= CollectEmails
| ProcessTicket Int