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:

{-# 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 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
module CLI
( CLI(..)
, getCliArgs
) where
import Data.Semigroup ((<>))
import Options.Applicative (Parser, argument, auto, command, execParser, fullDesc, header,
help, helper, info, infoOption, long, metavar, progDesc,
strOption, subparser, (<**>))
import Paths_log_classifier (version)
@HirotoShioi
HirotoShioi / example.hs
Created July 11, 2018 05:14
Example of an decompressing and analyzing the zip file using zip libray (http://hackage.haskell.org/package/zip)
module Main where
import Codec.Archive.Zip
import Control.Monad (forM_)
import qualified Data.ByteString as BS
import qualified Data.Map.Strict as M
import Data.Text (Text)
import Data.Text.Encoding (decodeUtf8With)
import Data.Text.Encoding.Error (ignore)
import qualified Data.Text.IO as T