Stateモナドの解説 前編
Upcoming SlideShare
Loading in...5
×
 

Stateモナドの解説 前編

on

  • 2,333 views

 

Statistics

Views

Total Views
2,333
Views on SlideShare
2,333
Embed Views
0

Actions

Likes
3
Downloads
42
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Stateモナドの解説 前編 Stateモナドの解説 前編 Presentation Transcript

  • State 2009 5 31 id:hiratara
  • • • State
  • • URI Comparable Interface Comparable URI View slide
  • (1) View slide
  • Bool length Float fst Integer take MyType zip (Int, Bool) myfunc [Char] id Maybe String ... Int → Int → Int ...
  • Bool length Float fst Integer take MyType zip (Int, Bool) myfunc [Char] id Maybe String ... Int → Int → Int ...
  • Bool length Float fst Integer take MyType zip (Int, Bool) myfunc [Char] id Maybe String ... Int → Int → Int ...
  • id f -> f quot;abcquot; [Char] id head [Char] -> [Char] Char id length take Int id
  • id f -> f quot;abcquot; [Char] id head [Char] → [Char] Char id length take Int id
  • (2)
  • : Maybe [Char] Maybe [Char] Maybe length liftM length Maybe Int Maybe Int
  • [] [Char] [ [Char] ] [] length liftM length [] Int [ Int ]
  • [] [Char] [] [Char] [ [Char] ] [] length liftM length [] Int [ Int ]
  • liftM Maybe [] [Char] [ [Char] ] [] length liftM length [] Int [ Int ]
  • (3) return
  • : Maybe return [Char] Maybe [Char] return Int Maybe Int
  • [] return [Char] [ [Char] ] return Int [ Int ]
  • return State return [Char] State [Char] return Bool State Bool return MyType State MyType return IO String State (IO String)
  • (4) (>>=)
  • Maybe [Char] Maybe [Char] func Int Maybe Int Maybe
  • (>>=) Maybe [Char] Maybe [Char] (>>=) func (=<<) func Int Maybe Int Maybe
  • State (>>=) [Char] State [Char] func1 (=<<) func1 (>>=) Int State Int func2 (=<<) func2 MyType State MyType
  • return IO [Char] IO [Char] length return Int IO Int
  • IO [Char] IO [Char] return . length length return Int IO Int
  • (>>=) liftM IO [Char] (>>=) IO [Char] return . length length (=<<) $ return . length return Int IO Int
  • • • return • (>>=)
  • • • • State
  • • Haskell Kleisli triple Monad • Kleisli triple Monad • Kleisli triple liftM ( Monad )