Hatena::Grouphaskell

suztomoの日記

 | 

2011-10-09

HaskellのDebugger

15:59

GHCiはdebugger付き。404 Not Found.

breakで行を指定して、走らせるとそこで止まって、
printもしくは:forceで表示。:forceはchunkを評価する。

Prelude Control.Monad> :load "/Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs"
[1 of 1] Compiling Main             ( /Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs, interpreted )
Ok, modules loaded: Main.
*Main Control.Monad> :break 3
Breakpoint 0 activated at /Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs:3:16-47
*Main Control.Monad> main
Stopped at /Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs:3:16-47
_result :: [a] = _
a :: a = _
left :: [a] = _
right :: [a] = _
[/Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs:3:16-47] *Main Control.Monad> a

<interactive>:1:1:
    Ambiguous type variable `a' in the constraint:
      (Show a) arising from a use of `print'
    Cannot resolve unknown runtime types: a
    Use :print or :force to determine these types
    In a stmt of an interactive GHCi command: print it
[/Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs:3:16-47] *Main Control.Monad> :set -fprint-evld-with-show
[/Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs:3:16-47] *Main Control.Monad> :print left
left = (_t1::[a])
[/Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs:3:16-47] *Main Control.Monad> :force left
left = [4,0,3,1]
[/Users/suztomo/Documents/LanguageStudy/Haskell/Monad/qsort.hs:3:16-47] *Main Control.Monad> :print left
left = [4,0,3,1]

monad transformer

13:01

複数のモナドを一緒に扱いたい場合はtransformerを使います。Standard monad transformers

liftが使えると、一つのモナドの中で他のモナドを操作することができます。

import Control.Monad.State

lt :: StateT String IO Int
lt = do
  let x = 3 + 5
  p <- get
  put $ (show x) ++ "," ++ p
  liftIO $ putStrLn $ show x
  let y = (x * 9 :: Int)
  q <- get
  put $ (show y) ++ "," ++ q
  return (x + y)

l :: State String Int
l = do
  let x = 3 + 5
  p <- get
  put $ (show x) ++ "," ++ p
  -- liftIO $ putStrLn $ show x
  let y = (x * 9 :: Int)
  q <- get
  put $ (show y) ++ "," ++ q
  return (x + y)

main :: IO ()
main = do
  let (i, s) = runState l "init"
  putStrLn $ show i
  putStrLn $ show s
  (i, s) <- runStateT lt "init2"
  putStrLn $ show i
  putStrLn $ show s
  return ()

*Main Control.Monad> :info State
type State s = StateT s Data.Functor.Identity.Identity
  	-- Defined in Control.Monad.Trans.State.Lazy

インモラルインモラル2013/09/23 11:23淫インモラル:http://immoral.hellokanpo.com
インモラル:http://immoral.hellokanpo.com
媚薬 淫インモラル:http://immoral.hellokanpo.com
媚薬 インモラル:http://immoral.hellokanpo.com
妖姫:http://youhi.hellokanpo.com
媚薬 妖姫:http://youhi.hellokanpo.com


花痴:http://花痴.happykanpo.com
花痴:http://xn--dtyr5y.happykanpo.com
威哥王:http://www.onbape.com
イカオウ:http://www.onbape.com
紅蜘蛛:http://www.shkanpo.com
紅蜘蛛:http://www.shkanpo.com


威哥王:http://www.hellokanpo.com/view/weigewang.html
巨人倍増:http://www.hellokanpo.com/view/jurenbeiceng.html
三便宝:http://www.hellokanpo.com/view/satibo-capsules.html
D10 媚薬:http://www.hellokanpo.com/view/D10-meiyao.html
RU486:http://www.hellokanpo.com/view/beijing-ru486.html
花痴:http://www.hellokanpo.com/view/huachi.html
紅蜘蛛:http://www.hellokanpo.com/view/hongzhizhu1.html

威哥王:http://www.hellokanpo.com/view/weigewang.html
キョジンバイゾウ:http://www.hellokanpo.com/view/jurenbeiceng.html
D10 催情剤:http://www.hellokanpo.com/view/D10-meiyao.html
さんべんぼう:http://www.hellokanpo.com/view/satibo-capsules.html
イーリーシン:http://www.hellokanpo.com/view/yilishen.html
狼1号:http://www.hellokanpo.com/view/langyihao.html
三體牛鞭:http://www.hellokanpo.com/view/santiniubian.html
韓国痩身1号:http://www.hellokanpo.com/view/hanguoshou-575.html


精力剤:http://www.hellokanpo.com/JingLiJi
媚薬:http://www.hellokanpo.com/meiyao
威哥王:http://www.hellokanpo.com/view/weigewang.html
巨人倍増:http://www.hellokanpo.com/view/jurenbeiceng.html
天天素:http://www.hellokanpo.com/view/tiantiansu.html
三便宝:http://www.hellokanpo.com/view/satibo-capsules.html
蟻力神:http://www.hellokanpo.com/view/yilishen.html
RU486:http://www.hellokanpo.com/view/beijing-ru486.html
韓国痩身1号:http://www.hellokanpo.com/view/hanguoshou-575.html
D10 媚薬:http://www.hellokanpo.com/view/D10-meiyao.html
福源春:http://www.hellokanpo.com/view/fuyuanchun.html
狼一号:http://www.hellokanpo.com/view/langyihao.html
花痴:http://www.hellokanpo.com/view/huachi.html
紅蜘蛛:http://www.hellokanpo.com/view/hongzhizhu1.html
巨根カプセル:http://www.hellokanpo.com/view/jugen.html
三體牛鞭:http://www.hellokanpo.com/view/santiniubian.html
三体牛鞭:http://www.hellokanpo.com/view/santiniubian.html
絶對高潮:http://www.hellokanpo.com/view/jueduigaochao.html
SEX DROPS:http://www.hellokanpo.com/view/sex-drops.html
D10 催情剤:http://www.hellokanpo.com/view/D10-meiyao.html
終極痩身:http://www.hellokanpo.com/view/zhongjishoushen.html
超級脂肪燃焼弾:http://www.hellokanpo.com/view/FATBURNING.html
SUPER FAT BURNING:http://www.hellokanpo.com/view/SUPERFATBURNING.html
D5 原液:http://www.hellokanpo.com/view/FLYD5yuan.html
新一粒神:http://www.hellokanpo.com/view/xinyilishen.html
ビグレックス:http://www.hellokanpo.com/view/Oil.html
蔵八宝:http://www.hellokanpo.com/view/zhangbabao.html
御秀堂:http://www.hellokanpo.com/view/yuxiutang.html
中絶薬:http://www.hellokanpo.com/zhongjue


イーリーシン:http://www.hellokanpo.com/view/yilishen.html
ED助勃:http://www.hellokanpo.com
催情:http://www.hellokanpo.com/view/D10-meiyao.html
五便宝:http://www.hellokanpo.com/view/wodibo-capsules.html
キョジンバイゾウ:http://www.hellokanpo.com/view/jurenbeiceng.html
蒼蝿水:http://www.hellokanpo.com/view/FLY-D5.html
催淫カプセル:http://www.hellokanpo.com/view/jueduigaochao.html
VigRx:http://www.hellokanpo.com/view/VigRx.html
五便宝カプセル:http://www.hellokanpo.com/view/wodibo-capsules.html
ウェイカワン:http://www.hellokanpo.com/view/weigewang.html
VVK:http://www.hellokanpo.com/view/VVK-Wenickman.html
狼1号:http://www.hellokanpo.com/view/langyihao.html
女性催情剤:http://www.hellokanpo.com/view/d10-meiyao.html
男宝:http://www.hellokanpo.com/view/nanbao.html
vigRx oil:http://www.hellokanpo.com/view/Oil.html
曲美:http://www.hellokanpo.com/view/qumei.html
SPANISCHE FLIEGE:http://www.hellokanpo.com/view/spanische-flieged5-1.html
Wenickman:http://www.hellokanpo.com/view/VVK-Wenickman.html
FLY D5:http://www.hellokanpo.com/view/FLY-D5.html
催情水:http://www.hellokanpo.com/view/Foot.html
ペニス増大:http://www.hellokanpo.com/JingLiJi/xingqi.html
蟻王:http://www.hellokanpo.com/view/antking.html
ナンパオ:http://www.hellokanpo.com/view/nanbao.html
ベニクモ:http://www.hellokanpo.com/view/hong-zhi-zhu.html
韓国痩身一号:http://www.hellokanpo.com/view/hanguoshou-575.html
ハナチ:http://www.hellokanpo.com/view/huachi.html
セックスドロップ:http://www.hellokanpo.com/view/sex-drops.html
男根増長素:http://www.hellokanpo.com/view/nangen.html
三鞭粒:http://www.hellokanpo.com/view/wei.html
九鞭粒:http://www.hellokanpo.com/view/jiubianli.html
V26:http://www.hellokanpo.com/view/V26.html
日本秀身堂:http://www.hellokanpo.com/view/xouzhentang.html
procomil spray:http://www.hellokanpo.com/view/procomil-spray.html
蒼蝿粉:http://www.hellokanpo.com/view/inverma.html
性霸2000:http://www.hellokanpo.com/view/xingba2000.html
v26 ダイエット:http://www.hellokanpo.com/view/V26.html
魔根:http://www.hellokanpo.com/view/muogen.html
花之欲:http://www.hellokanpo.com/view/huazhiyu.html
Xing霸:http://www.hellokanpo.com/view/xingba2000.html
美人豹:http://www.hellokanpo.com/view/meirenbao.html
アリ王:http://www.hellokanpo.com/view/antking.html
男露888:http://www.hellokanpo.com/view/nanlu888.html
消渇丸:http://www.hellokanpo.com/view/xiaokewan.html
RU486中絶薬:http://www.hellokanpo.com/view/beijing-ru486.html
西班牙昆虫粉:http://www.hellokanpo.com/view/kunchong-fen.html
壮三天:http://www.hellokanpo.com/view/zhuangsantian.html
モチベーター:http://www.hellokanpo.com/view/Motivat.html
小情人:http://www.hellokanpo.com/view/sex-drops5.html
motivator:http://www.hellokanpo.com/view/Motivat.html
早漏防止:http://www.hellokanpo.com/JingLiJi/zaoxie.html
漢方薬 通販:http://www.hellokanpo.com/hanfang
ED治療薬:http://www.hellokanpo.com
VOV催情液:http://www.hellokanpo.com/view/VOVcuiqingye.html
勃起促進:http://www.hellokanpo.com/view/weigewang.html
女性用媚薬:http://www.hellokanpo.com/meiyao
漢方ダイエット:http://www.hellokanpo.com/jianfei/hfjianfei.html
ダイエット薬:http://www.hellokanpo.com/jianfei/xinchendaixie.html
黒倍王:http://www.hellokanpo.com/view/heibeiwang.html
さんべんぼう:http://www.hellokanpo.com/view/satibo-capsules.html
リドスプレー:http://www.hellokanpo.com/view/Lidosprayer.html
魔鬼天使性欲粉:http://www.hellokanpo.com/view/mogui-tianshi.html
イカオウ:http://www.hellokanpo.com/view/wei.html
vigrx 効果:http://www.hellokanpo.com/view/vigrx.html
福源春カプセル:http://www.hellokanpo.com/view/fuyuanchun.html
威哥王 販売:http://www.hellokanpo.com/view/weigewang.html
紅蜘蛛 液体:http://www.hellokanpo.com/view/hong-zhi-zhu.html
紅蜘蛛 激安:http://www.hellokanpo.com/view/hong-zhi-zhu-meiyao.html
三便宝 激安:http://www.hellokanpo.com/view/satibo-capsules5.html
三便宝 販売:http://www.hellokanpo.com/view/satibo-capsules.html

蟻力神蟻力神2014/09/26 20:34蟻力神 : http://www.蟻力神.com/
即効精力剤 : http://www.蟻力神.com/Class.asp?id=1
蟻力神(イーリーシン) : http://www.蟻力神.com/xClass.asp?id=2
即効 精力剤 : http://www.蟻力神.com/xClass.asp?id=3
媚薬・催淫 : http://www.蟻力神.com/xClass.asp?id=4

紅蜘蛛 : http://www.蟻力神.com/Product.asp?id=24
Spain Sex Element: http://www.蟻力神.com/Product.asp?id=23
威哥王: http://www.蟻力神.com/Product.asp?id=13
紅蜘蛛(媚薬催情粉) : http://www.蟻力神.com/Product.asp?id=12
花痴: http://www.蟻力神.com/Product.asp?id=11
蟻立神活力カプセル : http://www.蟻力神.com/Product.asp?id=10
蟻力神 第八代 : http://www.蟻力神.com/Product.asp?id=9
福潤宝: http://www.蟻力神.com/Product.asp?id=8
新一粒神: http://www.蟻力神.com/Product.asp?id=7
樂翻天: http://www.蟻力神.com/Product.asp?id=6
中華牛鞭 : http://www.蟻力神.com/Product.asp?id=4
蟻力神(ありんこパワー) : http://www.蟻力神.com/Product.asp?id=3
蔵秘雄精 : http://www.蟻力神.com/Product.asp?id=2
蟻力神: http://www.蟻力神.com/Product.asp?id=1
蟻力神(第五代) : http://www.蟻力神.com/Product.asp?id=5
威哥王: http://www.蟻力神.com/Product.asp?id=13
蒼蝿水(FLY D5原液): http://www.蟻力神.com/Product.asp?id=17
MaxWomanSex 媚薬: http://www.蟻力神.com/Product.asp?id=16
FAMPROX(強力媚薬) : http://www.蟻力神.com/Product.asp?id=15
巨人倍増枸杞カプセル : http://www.蟻力神.com/Product.asp?id=14
絶對高潮: http://www.蟻力神.com/Product.asp?id=22
西班牙蒼蝿迷情液 (gold fly): http://www.蟻力神.com/Product.asp?id=21
美人豹: http://www.蟻力神.com/Product.asp?id=20
魔鬼天使性欲粉(Muira Puama) : http://www.蟻力神.com/Product.asp?id=19
魔鬼天使性欲粉 強力催情(Muira Puama) : http://www.蟻力神.com/Product.asp?id=18

三體牛鞭三體牛鞭2014/09/26 20:34三體牛鞭 : http://www.三體牛鞭.com/
VIVID XXL : http://www.三體牛鞭.com/Product.asp?id=10
巨根 : http://www.三體牛鞭.com/Product.asp?id=9
夜狼神 : http://www.三體牛鞭.com/Product.asp?id=8
巨人倍増枸杞カプセル : http://www.三體牛鞭.com/Product.asp?id=7
勃動力三體牛鞭 : http://www.三體牛鞭.com/Product.asp?id=6
威哥王 : http://www.三體牛鞭.com/Product.asp?id=5
三體牛寶 : http://www.三體牛鞭.com/Product.asp?id=4
蟻力神 : http://www.三體牛鞭.com/Product.asp?id=3
中華牛鞭 : http://www.三體牛鞭.com/Product.asp?id=2
勃動力三體牛鞭 : http://www.三體牛鞭.com/Product.asp?id=1
新版 三体牛鞭 : http://www.三體牛鞭.com/Product.asp?id=1
中華牛鞭: http://www.中華牛鞭.com/
三體牛鞭: http://www.中華牛鞭.com/Product.asp?id=10
三体牛鞭: http://www.中華牛鞭.com/Product.asp?id=10
威哥王: http://www.中華牛鞭.com/Product.asp?id=9
福潤宝: http://www.中華牛鞭.com/Product.asp?id=8
巨人倍増: http://www.中華牛鞭.com/Product.asp?id=7
蔵秘雄精 : http://www.中華牛鞭.com/Product.asp?id=6
MaxMan: http://www.中華牛鞭.com/Product.asp?id=5
蟻力神: http://www.中華牛鞭.com/Product.asp?id=4
華佗生精丸: http://www.中華牛鞭.com/Product.asp?id=3
蔵八宝: http://www.中華牛鞭.com/Product.asp?id=2
中華牛鞭 通販 : http://www.中華牛鞭.com/Product.asp?id=1

漢方ダイエット薬漢方ダイエット薬2014/09/26 20:34漢方ダイエット薬 : http://www.cnslimming.net/
ダイエット薬 : http://www.cnslimming.net/Class.asp?id=1
即効ダイエット薬 : http://www.cnslimming.net/xClass.asp?id=2
紐斯葆濃縮藤黃果カプセル 第2代: http://www.cnslimming.net/Product.asp?id=11
修身堂神奇修身減肥コーヒー : http://www.cnslimming.net/Product.asp?id=10
FITX脂肪燃えるカプセル: http://www.cnslimming.net/Product.asp?id=9
繊之素カプセル 第2代 : http://www.cnslimming.net/Product.asp?id=8
紐斯葆OB蛋白: http://www.cnslimming.net/Product.asp?id=7
簡約痩身美体カプセル : http://www.cnslimming.net/Product.asp?id=6
超級脂肪燃焼弾 第4代 : http://www.cnslimming.net/Product.asp?id=5
天天素(清脂カプセル) : http://www.cnslimming.net/Product.asp?id=4
紐斯葆OB蛋白痩身素: http://www.cnslimming.net/Product.asp?id=3
V26 即効ダイエット薬: http://www.cnslimming.net/Product.asp?id=2
唯美OB蛋白痩身素 第4代 : http://www.cnslimming.net/Product.asp?id=1
V26 腹ダイエット薬: http://www.cnslimming.net/Product.asp?id=16
左旋肉碱(L-カルニチン): http://www.cnslimming.net/Product.asp?id=15
終極痩身: http://www.cnslimming.net/Product.asp?id=14
金妙姿ダイエット: http://www.cnslimming.net/Product.asp?id=13
紐斯葆濃縮藤黄果: http://www.cnslimming.net/Product.asp?id=12

 |