bdd.gby

Size: px
Start display at page:

Download "bdd.gby"

Transcription

1 Haskell Behavior Driven Development 1

2 Haskell 4 Mew Firemacs Mighty ghc-mod 2

3 Ruby/Java HackageDB 3

4 Haskeller 4

5 Haskeller 5

6 Q) Haskeller A) 6

7 7

8 Haskeller Haskell 8

9 9

10 10

11 Haskell 11

12 Haskell Haskell 12

13 13

14 Haskell 14

15 Haskell 15

16 Haskell 16

17 \^^/ 17

18 18

19 19

20 Haskeller HUnit QuickCheck 20

21 QuickCheck prop_doublesort :: [Int] -> Bool prop_doublesort xs = sort xs == sort (sort xs) > quickcheck prop_doublesort +++ OK, passed 100 tests. 21

22 22

23 Haskell QuickCheck sort :: Ord a => [a] -> [a] lookup :: Eq a => a -> [(a, b)] -> Maybe b delete :: Eq a => a -> [a] -> [a] HUnit ( ) hgetline :: Handle -> IO String writefile :: FilePath -> String -> IO () forkio :: IO () -> IO ThreadId 23

24

25 25

26 26

27 QuickCheck QuickCheck prop_model x xs = linearsearch x xs == binarysearch x xs 27

28 QuickCheck 28

29 Haskeller 29

30 Simon HENGEL doctest 30

31 doctest Python def factorial(n): """Return the factorial of n, an exact integer >= 0. If the result is small enough to fit in an int, return an int. Else return a long. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] >>> factorial(30) L """ import math if not n >= 0: raise ValueError("n must be >= 0")... 31

32 Haskell Haddock 32

33 Haddock -- unlines is an inverse operation to lines. -- It joins lines, after appending a terminating -- newline to each. unlines :: [String] -> String unlines [] = [] unlines (l:ls) = l ++ \n : unlines ls Haddock HTML 33

34 ">" Data.Map -- /O(1)/. Is the map empty? > Data.Map.null (empty) == True -- > Data.Map.null (singleton 1 a ) == False null :: Map k a -> Bool null Tip = True null (Bin _) = False 34

35 35

36 Simon HENGEL ">>>" >>> length [] 0 >>> writefile "tmpfile" "Hello" >>> readfile "tmpfile" "Hello" >>> head [] *** Exception: Prelude.head: empty list Haddock

37 doctest Haddock Haddock API 0.6 GHC API GHCi doctest 0.6.x GHCi 0.7 GHCi 37

38 "prop>" prop> Data.Map.null empty == True prop> \xs -> sort xs == sort (sort (xs::[int])) prop> sort xs == sort (sort (xs::[int])) Haddock 38

39 haskell-src-exts... GHCi > sort xs == sort (sort (xs::[int])) <interactive>:1:6: Not in scope: xs <interactive>:1:24: Not in scope: xs "\xs -> " 39

40 doctest doctest 40

41 v2.3 QuickCheck > quickcheck $ length [] == OK, passed 100 tests. True 100 v2.4 > quickcheck $ length [] == OK, passed 1 tests. 41

42 / > valid $ deletemin $ deletemin $ fromlist [(i,()) i <- [0,2,5,1,6,4,8,9,7,11,10,3]] False 42

43 Trystan SPANGLER Hspec 43

44 Q) Hspec A) Ruby Rspec Haskell Rspec BDD 44

45 Q) BDD (Behavior Driven Development) A) TDD (Test Driven Development) 45

46 Haskell 46

47 Hspec describe "deletemin" $ do it "maintains the balance even if applied doubly" $ valid $ deletemin $ deletemin $ fromlist [(i::int,()) i <- [0,2,5,1,6,4,8,9,7,11,10,3]] it... it... it... 47

48 IO setup teardown withdb action = bracket (connectsqlite3 "my.db") disconnect action describe "database adaptor" $ do it "returns 23, when 23 is selected" $ withdb $ \connection -> run connection "select 23;" shouldreturn 23 48

49 Haskell Behavior Driven Development 49

50 Haskell BDD (1) (1) rev :: [a] -> [a] rev = undefined undefined undefined undefined placeholders notimplemented todo 50

51 Haskell BDD (2) (2) Haddock rev returns the elements of -- in reverse order. must be finite >>> rev [1,2,3] -- [3,2,1] prop> rev [] == rev [] -- prop> rev (xs++ys) == rev ys ++ rev (xs::[int]) -- prop> rev (rev xs) == (xs::[int]) rev :: [a] -> [a] rev = undefined 51

52 Haskell BDD (3) (3) Hspec describe "rev" $ do it "returns the first element in the last" $ property $ \xs -> not (null xs) ==> head (rev xs) == last (xs :: [Int]) it "returns the last element in the first" $ property $ \xs -> not (null xs) ==> last (rev xs) == head (xs :: [Int]) 52

53 (4) Haskell BDD (4) rev :: [a] -> [a] rev = foldl (flip (:)) [] doctest Hspec Cabal cabal test test-suite doctests type: exitcode-stdio-1.0 main-is: doctests.hs build-depends: base, doctest test-suite spec type: exitcode-stdio-1.0 main-is: Spec.hs build-depends: base, hspec 53

54 rev = foldl (flip (:)) [] ghc-mod rev :: [a] -> [a] rev = foldl (flip (:)) [] >>> rev [1,2,3] -- [3,2,1] rev :: [a] -> [a] rev = foldl (flip (:)) [] 54

55 QuickCheck doctest Hspec ( ) Cabal 55

56 Simon HENGEL (doctest Hspec ) Hspec github issue 56

test.gby

test.gby Beautiful Programming Language and Beautiful Testing 1 Haskeller Haskeller 2 Haskeller (Doctest QuickCheck ) github 3 Haskeller 4 Haskell Platform 2011.4.0.0 Glasgow Haskell Compiler + 23 19 8 5 10 5 Q)

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

haskell.gby

haskell.gby Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]

More information

2

2 2011.11.11 1 2 MapReduce 3 4 5 6 Functional Functional Programming 7 8 9 10 11 12 13 [10, 20, 30, 40, 50] 0 n n 10 * 0 + 20 * 1 + 30 * 2 + 40 * 3 + 50 *4 = 400 14 10 * 0 + 20 * 1 + 30 * 2 + 40 * 3 + 50

More information

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp

org/ghc/ Windows Linux RPM 3.2 GHCi GHC gcc javac ghc GHCi(ghci) GHCi Prelude> GHCi :load file :l file :also file :a file :reload :r :type expr :t exp 3 Haskell Haskell Haskell 1. 2. 3. 4. 5. 1. 2. 3. 4. 5. 6. C Java 3.1 Haskell Haskell GHC (Glasgow Haskell Compiler 1 ) GHC Haskell GHC http://www.haskell. 1 Guarded Horn Clauses III - 1 org/ghc/ Windows

More information

2011.12.3 1 2 Q) A) 3 Q) A) 4 5 6 Haskell 7 8 Parser data Parser a = Parser (String -> [(a,string)]) Parser pwrap :: a -> Parser a pwrap v = Parser $ \inp -> [(v,inp)] Parser pbind :: Parser a -> (a ->

More information

kyoto.gby

kyoto.gby Haskell 2013.5.24 1 2 1988 B4 Sun 1992 3 Unix Magazine Unix Magazine UNIX RFC FYI (For Your Information) 4 IP PEM (Privacy Enhanced Mail) WIDE Project mh-e PEM 5 6 Unix Magazine PGP PGP 1 7 Mew (MIME)

More information

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B

3 3.1 algebraic datatype data k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] B 3 3.1 algebraic datatype data 1 2... k = 1 1,1... 1,n1 2 2,1... 2,n2... m m,1... m,nm 1 m m m,1,..., m,nm m 1, 2,..., k 1 data Foo x y = Alice x [y] Bob String y Charlie Foo Double Integer Alice 3.14 [1,2],

More information

monad.gby

monad.gby 2012.11.18 1 1 2 2 DSL 3 4 Q) A) 5 Q) A) 6 7 8 Haskell 9 10 Parser data Parser a = Parser (String -> [(a,string)]) Parser pwrap :: a -> Parser a pwrap v = Parser $ \inp -> [(v,inp)] Parser pbind :: Parser

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 1, 2 of 14 ( RD S ) I 1, 2 of 14 1 / 44 Ruby Ruby ( RD S ) I 1, 2 of 14 2 / 44 7 5 9 2 9 3 3 2 6 5 1 3 2 5 6 4 7 8 4 5 2 7 9 6 4 7 1 3 ( RD S ) I 1, 2

More information

Copyright c 2006 Zhenjiang Hu, All Right Reserved.

Copyright c 2006 Zhenjiang Hu, All Right Reserved. 1 2006 Copyright c 2006 Zhenjiang Hu, All Right Reserved. 2 ( ) 3 (T 1, T 2 ) T 1 T 2 (17.3, 3) :: (Float, Int) (3, 6) :: (Int, Int) (True, (+)) :: (Bool, Int Int Int) 4 (, ) (, ) :: a b (a, b) (,) x y

More information

Copyright c 2008 Zhenjiang Hu, All Right Reserved.

Copyright c 2008 Zhenjiang Hu, All Right Reserved. 2008 10 27 Copyright c 2008 Zhenjiang Hu, All Right Reserved. (Bool) True False data Bool = False True Remark: not :: Bool Bool not False = True not True = False (Pattern matching) (Rewriting rules) not

More information

連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines "" = [] lines s = let (l,s'

連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines  = [] lines s = let (l,s' 連載 構文解析器結合子 山下伸夫 (( 株 ) タイムインターメディア ) nobsun@sampou.org 文字列の分解 1 1 Haskell lines Prelude lines :: String -> [String] lines "" = [] lines s = let (l,s') = break ('\n'==) s in l : case s' of [] -> [] (_:s'')

More information

2

2 Haskell ( ) kazu@iij.ad.jp 1 2 Blub Paul Graham http://practical-scheme.net/trans/beating-the-averages-j.html Blub Blub Blub Blub 3 Haskell Sebastian Sylvan http://www.haskell.org/haskellwiki/why_haskell_matters...

More information

第8回 関数

第8回 関数 1 関数型プログラミング 第 8 回関数 萩野達也 hagino@sfc.keio.ac.jp 2 関数定義 square n = n * n 与えられた数の 2 乗を計算する square 関数を定義している. 変数 square に 2 乗を計算する関数を束縛 (bind) したい. a = 10 変数 a に定数 10 を束縛する. square =... 3 高階関数 関数も値の一つである.

More information

presen.gby

presen.gby kazu@iij.ad.jp 1 2 Paul Graham 3 Andrew Hunt and David Thomas 4 5 Java 6 Java Java Java 3 7 Haskell Scala Scala 8 9 Java Java Dean Wampler AWT ActionListener public interface ActionListener extends EventListener

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

Functional Programming

Functional Programming PROGRAMMING IN HASKELL プログラミング Haskell Chapter 7 - Higher-Order Functions 高階関数 愛知県立大学情報科学部計算機言語論 ( 山本晋一郎 大久保弘崇 2013 年 ) 講義資料オリジナルは http://www.cs.nott.ac.uk/~gmh/book.html を参照のこと 0 Introduction カリー化により

More information

ohp03.dvi

ohp03.dvi 19 3 ( ) 2019.4.20 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void int main(int argc, char *argv[]) {... 2 (2) argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0

More information

ruby novice ruby novice ruby novice.

ruby novice ruby novice ruby novice. GitHub Ruby 2549 2017 3 1 1 3 2 4 2.1 ruby novice........................... 4 2.2.............................. 6 3 8 3.1 ruby novice....................... 8 3.2 ruby novice............................

More information

Q&A集

Q&A集 & ver.2 EWEB-3C-N080 PreSerV for Web MapDataManager & i 1... 1 1.1... 1 1.2... 2 1.3... 6 1.4 MDM. 7 1.5 ( )... 9 1.6 ( )...12 1.7...14 1.8...15 1.9...16 1.10...17 1.11...18 1.12 19 1.13...20 1.14...21

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

listings-ext

listings-ext (6) Python (2) ( ) ohsaki@kwansei.ac.jp 5 Python (2) 1 5.1 (statement)........................... 1 5.2 (scope)......................... 11 5.3 (subroutine).................... 14 5 Python (2) Python 5.1

More information

新・明解Java入門

新・明解Java入門 537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

(CC Attribution) Lisp 2.1 (Gauche )

(CC Attribution) Lisp 2.1 (Gauche ) http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) Lisp 2.1 (Gauche ) 2 2000EY-Office 3 4 Lisp 5 New York The lisps Sammy Tunis flickr lisp http://www.flickr.com/photos/dust/3603580129/ (CC

More information

第9回 型とクラス

第9回 型とクラス 1 関数型プログラミング 第 9 回型とクラス 萩野達也 hagino@sfc.keio.ac.jp 2 静的型検査と型推論 型 値の集合 Bool = { True, False } Char = { 'a', 'b',... } Int = {... -2, -1, 0, 1, 2, 3,... } 静的型検査 Haskell はコンパイル時に式の型を検査する 静的 = コンパイル時 (v.s.

More information

ohp08.dvi

ohp08.dvi 19 8 ( ) 2019.4.20 1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: 2 (2) NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( 2) 3 (3) head cur tail head cur prev data

More information

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf ("%s", str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i

1 # include < stdio.h> 2 # include < string.h> 3 4 int main (){ 5 char str [222]; 6 scanf (%s, str ); 7 int n= strlen ( str ); 8 for ( int i=n -2; i ABC066 / ARC077 writer: nuip 2017 7 1 For International Readers: English editorial starts from page 8. A : ringring a + b b + c a + c a, b, c a + b + c 1 # include < stdio.h> 2 3 int main (){ 4 int a,

More information

第12回 モナドパーサ

第12回 モナドパーサ 1 関数型プログラミング 第 13 回モナドパーサ 萩野達也 hagino@sfc.keio.ac.jp Slide URL https://vu5.sfc.keio.ac.jp/slide/ 2 モナドパーサ モナドを使って構文解析を行ってみましょう. data Parser a = Parser (String -> Maybe (a, String)) 字句解析も構文解析の一部に含めてしまいます.

More information

{:from => Java, :to => Ruby } Java Ruby KAKUTANI Shintaro; Eiwa System Management, Inc.; a strong Ruby proponent http://kakutani.com http://www.amazon.co.jp/o/asin/4873113202/kakutani-22 http://www.amazon.co.jp/o/asin/477413256x/kakutani-22

More information

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=>

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=> Ruby Ruby 200779 ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( 2+3+4+5+6+7+8+9 ) 44 irb(main):002:0> irb irb(main):001:0> 1+2+3+4 => 10 irb(main):002:0>

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool VDM-SL VDM++ 23 6 28 VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web 2 1 3 1.1............................................... 3 1.1.1 bool......................................... 3 1.1.2 real rat int

More information

「プログラミング言語」 SICP 第4章 ~超言語的抽象~ その6

「プログラミング言語」  SICP 第4章   ~超言語的抽象~   その6 SICP 4 6 igarashi@kuis.kyoto-u.ac.jp July 21, 2015 ( ) SICP 4 ( 6) July 21, 2015 1 / 30 4.3: Variations on a Scheme Non-deterministic Computing 4.3.1: amb 4.3.2: 4.3.3: amb ( ) SICP 4 ( 6) July 21, 2015

More information

Parametric Polymorphism

Parametric Polymorphism ML 2 2011/04/19 Parametric Polymorphism Type Polymorphism ? : val hd_int : int list - > int val hd_bool : bool list - > bool val hd_i_x_b : (int * bool) list - > int * bool etc. let hd_int = function (x

More information

Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo if 11 for 11 range 12 break continue 13 pass

Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo if 11 for 11 range 12 break continue 13 pass Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo 6 6 7 9 10 11 if 11 for 11 range 12 break continue 13 pass 13 13 14 15 15 23 23 24 24 24 25 import 26 27-1- Boo Boo Python CLI.NET

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

Ver.1 1/17/2003 2

Ver.1 1/17/2003 2 Ver.1 1/17/2003 1 Ver.1 1/17/2003 2 Ver.1 1/17/2003 3 Ver.1 1/17/2003 4 Ver.1 1/17/2003 5 Ver.1 1/17/2003 6 Ver.1 1/17/2003 MALTAB M GUI figure >> guide GUI GUI OK 7 Ver.1 1/17/2003 8 Ver.1 1/17/2003 Callback

More information

Jacques Garrigue

Jacques Garrigue Jacques Garrigue Garrigue 1 Garrigue 2 $ print_lines () > for i in $1; do > echo $i > done $ print_lines "a b c" a b c Garrigue 3 Emacs Lisp (defun print-lines (lines) (dolist (str lines) (insert str)

More information

RX600 & RX200シリーズ アプリケーションノート RX用仮想EEPROM

RX600 & RX200シリーズ アプリケーションノート RX用仮想EEPROM R01AN0724JU0170 Rev.1.70 MCU EEPROM RX MCU 1 RX MCU EEPROM VEE VEE API MCU MCU API RX621 RX62N RX62T RX62G RX630 RX631 RX63N RX63T RX210 R01AN0724JU0170 Rev.1.70 Page 1 of 33 1.... 3 1.1... 3 1.2... 3

More information

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN

More information

橡SPA2000.PDF

橡SPA2000.PDF XSLT ( ) d-oka@is.s.u-tokyo.ac.jp ( ) hagiya@is.s.u-tokyo.ac.jp XSLT(eXtensible Stylesheet Language Transformations) XML XML XSLT XSLT XML XSLT XML XSLT XML XML XPath XML XSLT XPath XML XSLT,XPath 1 XSLT([6])

More information

Functional Programming

Functional Programming PROGRAMMING IN HASKELL プログラミング Haskell Chapter 9 - Interactive Programs 対話プログラム 愛知県立大学情報科学部計算機言語論 ( 山本晋一郎 大久保弘崇 2011 年 ) 講義資料オリジナルは http://www.cs.nott.ac.uk/~gmh/book.html を参照のこと 0 Introduction 8 章まで Haskell

More information

tkk0408nari

tkk0408nari SQLStatement Class Sql Database SQL Structured Query Language( ) ISO JIS http://www.techscore.com/tech/sql/02_02.html Database sql Perl Java SQL ( ) create table tu_data ( id integer not null, -- id aid

More information

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name = "" => "" > item.valid? => true valid? true false

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name =  =>  > item.valid? => true valid? true false 10 (1) 16 7 PicoPlanner validations 10.1 PicoPlanner Web Web invalid values validations Rails validates validate 107 10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 11 20 p.1/34 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

1/8 ページ Java 基礎文法最速マスター Java Javaの文法一覧です 他の言語をある程度知っている人はこれを読めばJavaの基礎をマスターしてJavaを書くことができるようになっています 簡易リファレンスとしても利用できると思いますので これは足りないと思うものがあれば教えてください 1. 基礎 class の作成プログラムはclassに記述します たとえばSampleという名前のclassを作る場合

More information

(1/2) 2/45 HPC top runner application programmer PC-9801F N88-BASIC Quick BASIC + DOS ( ) BCB Windows Percolation, Event-driven MD ActionScript Flash

(1/2) 2/45 HPC top runner application programmer PC-9801F N88-BASIC Quick BASIC + DOS ( ) BCB Windows Percolation, Event-driven MD ActionScript Flash 1/45 8 Outline 1. 2. 3. 4. Jun. 6, 2013@ A (1/2) 2/45 HPC top runner application programmer PC-9801F N88-BASIC Quick BASIC + DOS ( ) BCB Windows Percolation, Event-driven MD ActionScript Flash MPI MD (2/2)

More information

3360 druby Web Who is translating it? http://dx.doi.org/10.1007/s10766-008-0086-1 $32.00 International Journal of PARALLEL PROGRAMING Must buy! http://dx.doi.org/10.1007/s10766-008-0086-1 toruby The

More information

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1 () 2006 2 27 1 10 23 () 30 () 27 [1] p.97252 7 2 2.1 2.1.1 1 LIFO(last in first out, ) (push) (pup) 1 1: 2.1.2 1 List 4-1(p.100) stack[] stack top 1 2 (push) (pop) 1 2 void stack push(double val) val stack

More information

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装 Ruby Scheme 2013-04-16 ( )! SICP *1 ;-) SchemeR SICP MIT * 1 Structure and Interpretaion of Computer Programs 2nd ed.: 2 i SchemeR Ruby Ruby Ruby Ruby & 3.0 Ruby ii https://github.com/ichusrlocalbin/scheme_in_ruby

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

1. A0 A B A0 A : A1,...,A5 B : B1,...,B 1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 3. 4. 5. A0 A, B Z Z m, n Z m n m, n A m, n B m=n (1) A, B (2) A B = A B = Z/ π : Z Z/ (3) A B Z/ (4) Z/ A, B (5) f : Z Z f(n) = n f = g π g : Z/ Z A, B (6)

More information

fx-9860G Manager PLUS_J

fx-9860G Manager PLUS_J fx-9860g J fx-9860g Manager PLUS http://edu.casio.jp k 1 k III 2 3 1. 2. 4 3. 4. 5 1. 2. 3. 4. 5. 1. 6 7 k 8 k 9 k 10 k 11 k k k 12 k k k 1 2 3 4 5 6 1 2 3 4 5 6 13 k 1 2 3 1 2 3 1 2 3 1 2 3 14 k a j.+-(),m1

More information

test

test PostgreSQL CTO 5 2011 5 2011 9 2012 5 2013 10 2013 11 1 5000 JOIN 4 1. 2. 5 6 http://www.slideshare.net/mistakah/gpsgnss Location Base ( ) PostgreSQL x PostgreSQL 2011/8 MySQL MongoDB PostgreSQL GIS 2011/9

More information

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

離散数理工学 第 2回  数え上げの基礎:漸化式の立て方 2 okamotoy@uec.ac.jp 2015 10 20 2015 10 18 15:29 ( ) (2) 2015 10 20 1 / 45 ( ) 1 (10/6) ( ) (10/13) 2 (10/20) 3 ( ) (10/27) (11/3) 4 ( ) (11/10) 5 (11/17) 6 (11/24) 7 (12/1) 8 (12/8) ( ) (2) 2015 10 20

More information

ユニット・テストの概要

ユニット・テストの概要 2004 12 ... 3... 3... 4... 5... 6... 6 JUnit... 6... 7 Apache Cactus... 7 HttpUnit/ServletUnit... 8 utplsql... 8 Clover... 8 Anthill Pro... 9... 10... 10... 10 SQL... 10 Java... 11... 11... 12... 12 setter

More information

D0020.PDF

D0020.PDF n 3 X n Y n = Z n 17 1995 300 n n 2 3 2 a b c c 2 a 2 b 2 600 2000 322 3 15 2 3 580 3 1 5 4 3 2 1 300 2 1 2 1 1 ExcelVBA 2 VBA 1 VBA 2 API Sleep ExcelVBA 2 100 60 80 50 ExcelVBA API Sleep 3 100 60 (80

More information

Working Effectively with Legacy tdiary Code using Cucumber and RSpec KAKUTANI Shintaro; Eiwa System Management,Inc.; Nihon Ruby-no-kai pragprog.com Working Effectively with Legacy tdiary code using

More information

Microsoft PowerPoint - ProD0107.ppt

Microsoft PowerPoint - ProD0107.ppt プログラミング D M 講義資料 教科書 :6 章 中田明夫 nakata@ist.osaka-u.ac.jp 2005/1/7 プログラミング D -M- 1 2005/1/7 プログラミング D -M- 2 リスト 1 リスト : 同じ型の値の並び val h=[10,6,7,8,~8,5,9]; val h = [10,6,7,8,~8,5,9]: int list val g=[1.0,4.5,

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

10-C.._241_266_.Z

10-C.._241_266_.Z Windows 10 1 2 3 4 5 Visual Studio 2008LINQ MySchedule 242 Microsoft Visual C# 2008 10 Windows 243 1 LINQIEnumerableXML LINQ to Object q Form1.cs w RefreshListBox private void RefreshListBox() schedulelistbox.items.clear();

More information

ohp02.dvi

ohp02.dvi 172 2017.7.16 1 ? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X 2 ( ) 3 2-0 ( ) ( ) ( ) (12) ( ) (112) 31) 281 26 1 4 (syntax) (semantics) ( ) 5 BNF BNF(Backus Normal Form) Joun Backus (grammer) English grammer

More information

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println(Hello World); (Basic Theory of Information Processing) Java (eclipse ) Hello World! eclipse Java 1 3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello

More information

r1.dvi

r1.dvi Ruby 2009.9.7 1 ( ) --- ( ( ) ( ) 1 --- ( ) 1 ( ) (?) IT 7K( )?? ( ) ( )? IT ( ) --- ( ) 1 ( ) --- ( ) (?) 2-3% Top-Level ICT Professional 5% ICT Professional 10% 100% 50% 20% Devl. Experiment Adv. ICT

More information

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

「Android Studioではじめる 簡単Androidアプリ開発」正誤表

「Android Studioではじめる 簡単Androidアプリ開発」正誤表 Android Studio Android 2016/04/19 Android Studio Android *1 Android Studio Android Studio Android Studio Android Studio Android PDF : Android Studio Android Android Studio Android *2 c R TM *1 Android

More information

/ , ,908 4,196 2, ,842 38, / / 2 33 /

/ , ,908 4,196 2, ,842 38, / / 2 33 / MathWorks Automotive Conference 2014 ( ) ECU 0.1. 1 /30 1949 12 16 1,874 4 959 2 4,908 4,196 2,993 139,842 38,581 62 26 35 56 / 6 185 13 4 3 11 / 2 33 / 2014 3 31 0.1. 2 /30 ETC 0.2. 3 /30 1. 1. 2. 2.

More information

Functional Programming

Functional Programming PROGRAMMING IN HASKELL プログラミング Haskell Chapter 10 - Declaring Types and Classes 型とクラスの定義 愛知県立大学情報科学部計算機言語論 ( 山本晋一郎 大久保弘崇 2011 年 ) 講義資料オリジナルは http://www.cs.nott.ac.uk/~gmh/book.html を参照のこと 0 型宣言 (Type Declarations)

More information

Exam : 1z0-809 日本語 (JPN) Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO 1 / 8 Get Latest & Valid 1z0-809-JPN Exam's Question and Answe

Exam : 1z0-809 日本語 (JPN) Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO 1 / 8 Get Latest & Valid 1z0-809-JPN Exam's Question and Answe Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z0-809 日本語 (JPN) Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO 1 / 8 Get Latest &

More information

An introduction and future of Ruby coverage library

An introduction and future of Ruby coverage library Ruby の テストカバレッジ 測定機能の 改良と展望 クックパッド株式会社遠藤侑介 yusuke-oh@cookpad.com RubyWorld Conference 2017 (2017/11/01) 発表概要 発表内容 カバレッジとは カバレッジとの付き合い方 Ruby でのカバレッジ測定方法 クックパッドでのカバレッジ利用事例 発表者について フルタイム Ruby コミッタ (2017/09~)

More information

3360 druby Web Who is translating it? http://dx.doi.org/10.1007/s10766-008-0086-1 $32.00 International Journal of PARALLEL PROGRAMING Must buy! http://dx.doi.org/10.1007/s10766-008-0086-1 toruby LT Linux

More information

My関数の作成演習問題集

My関数の作成演習問題集 Excel Sum,Average,Max 330 BMI Excel My Excel VBA Visual BASIC Editor AltF11 Visual BASIC Editor My Function Function -1- Function ( As Single, As Single) As Double Function Funciton Funciton As Single

More information

「計算と論理」 Software Foundations その4

「計算と論理」  Software Foundations   その4 Software Foundations 4 cal17@fos.kuis.kyoto-u.ac.jp http://www.fos.kuis.kyoto-u.ac.jp/~igarashi/class/cal/ November 7, 2017 ( ) ( 4) November 7, 2017 1 / 51 Poly.v ( ) ( 4) November 7, 2017 2 / 51 : (

More information

JavaScript の使い方

JavaScript の使い方 JavaScript Release10.5 JavaScript NXJ JavaScript JavaScript JavaScript 2 JavaScript JavaScript JavaScript NXJ JavaScript 1: JavaScript 2: JavaScript 3: JavaScript 4: 1 1: JavaScript JavaScript NXJ Static

More information

unix15-script2_09.key

unix15-script2_09.key UNIX講習会 シェルスクリプト2 31/July/2015 情報管理解析室 西出 浩世 SGE ~/unix15/sge $ cd ~/unix15/sge $ ls script* script2.sh script3.sh script4.sh ~/unix15/sge/results sam 12 $ ls results/*.sam $ rm -r results $ cp -r /usr/local/data/unix15/sge/results.

More information

事例に見るSCORMの・・・

事例に見るSCORMの・・・ SCORM 1.2 2005 8 2004, 2005 i 2004 6 1.0 2004 6 1.02 3.1.1 2005 1 1.1 2.1.4, 2.4.9, 2.5.2, 2.5.3, 3.1.3, 3.4.6, 3.5.2, 3.5.3. 2005 8 1.2 2.1.1 BOM 2.2.2, 2.4.10, 3.1.1 BOM 3.2.2, 3.4.7. ii 1. 1 2. 2 2.1

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 5 3. 4. 5. A0 (1) A, B A B f K K A ϕ 1, ϕ 2 f ϕ 1 = f ϕ 2 ϕ 1 = ϕ 2 (2) N A 1, A 2, A 3,... N A n X N n X N, A n N n=1 1 A1 d (d 2) A (, k A k = O), A O. f

More information

Condition DAQ condition condition 2 3 XML key value

Condition DAQ condition condition 2 3 XML key value Condition DAQ condition 2009 6 10 2009 7 2 2009 7 3 2010 8 3 1 2 2 condition 2 3 XML key value 3 4 4 4.1............................. 5 4.2...................... 5 5 6 6 Makefile 7 7 9 7.1 Condition.h.............................

More information

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1 Java (9) 1 Lesson 7 2008-05-20 Java System.out.println() 1 Java API 1 Java Java 1 GUI 2 Java 3 1.1 5 3 1.0 10.0, 1.0, 0.5 5.0, 3.0, 0.3 4.0, 1.0, 0.6 1 2 4 3, ( 2 3 2 1.2 Java (stream) 4 1 a 5 (End of

More information

1.5 1...1 1.1... 1 1.2... 1 2... 2 2.1... 2 2.2 DB... 2 3... 3 3.1... 3 3.2... 3 4 DB... 4 4.1... 4 4.2... 6 4.3... 7 4.3.1.... 7 4.3.2.... 7 4.3.3.... 9 4.3.4.... 10 4.3.5.... 12 4.3.6.... 13 4.3.7....

More information

# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu

# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu II 4 : 2001 11 7 keywords: 1 OCaml OCaml (first-class value) (higher-order function) 1.1 1 2 + 2 2 + + n 2 sqsum 1 3 + 2 3 + + n 3 cbsum # let rec sqsum n = # if n = 0 then 0 else n * n + sqsum (n - 1)

More information

橡ボーダーライン.PDF

橡ボーダーライン.PDF 1 ( ) ( ) 2 3 4 ( ) 5 6 7 8 9 10 11 12 13 14 ( ) 15 16 17 18 19 20 ( ) 21 22 23 24 ( ) 25 26 27 28 29 30 ( ) 31 To be or not to be 32 33 34 35 36 37 38 ( ) 39 40 41 42 43 44 45 46 47 48 ( ) 49 50 51 52

More information

I 2 tutimura/ I 2 p.1/??

I 2   tutimura/ I 2 p.1/?? I 2 tutimura@mist.i.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/ 2002 4 25 I 2 p.1/?? / / Makefile I 2 p.2/?? Makefile make GNU make I 2 p.3/?? Makefile L A T E X I 2 p.4/?? core (1) gcc,

More information

導入基礎演習.ppt

導入基礎演習.ppt Multi-paradigm Programming Functional Programming Scheme Haskell ML Scala X10 KL1 Prolog Declarative Lang. C Procedural Lang. Java C++ Python Object-oriented Programming / (root) bin home lib 08 09

More information

クックパッドのテスト自動化

クックパッドのテスト自動化 JaSST 14 Tohoku クックパッド株式会社 高井 直人 スマホアプリ累計DL数 ios 1,010万 Android 990万 2014年4月時点 パズドラ 2,700万 黒猫 2,500万 Apache Rails 3.2 Ruby 2.0 Unicorn nginx MySQL Redis Memcached Amazon Web Service V字モデルとV

More information

RX501NC_LTE Mobile Router取説.indb

RX501NC_LTE Mobile Router取説.indb 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 2 3 4 5 6 7 8 19 20 21 22 1 1 23 1 24 25 1 1 26 A 1 B C 27 D 1 E F 28 1 29 1 A A 30 31 2 A B C D E F 32 G 2 H A B C D 33 E 2 F 34 A B C D 2 E 35 2 A B C D 36

More information

6 (1) app.html.eex 28 lib/nano_planner_web/templates/layout/app.html.eex 27 <footer> Oiax Inc <%= this_year() %> Oiax Inc. 29 </footer>

6 (1) app.html.eex 28 lib/nano_planner_web/templates/layout/app.html.eex 27 <footer> Oiax Inc <%= this_year() %> Oiax Inc. 29 </footer> 6 (1) of_today 6.1 Copyright 2017 lib/nano_planner_web/views layout_view.ex this_year/0 lib/nano_planner_web/views/layout_view.ex 1 defmodule NanoPlannerWeb.LayoutView do 2 use NanoPlannerWeb, view 3 +

More information

I HTML HashMap (i) (ii) :.java import java.net.*; import java.io.*; import java.util.hashmap; public class SimpleStopWatch { public static voi

I HTML HashMap (i) (ii) :.java import java.net.*; import java.io.*; import java.util.hashmap; public class SimpleStopWatch { public static voi II Java 10 2 12 10:30 12:00 I. I III II. III. IV. ( a d) V. : this==null, T == N A ActionListener C class D actionperformed G getsource I implements K KeyListener J JApplet L addmouselistener M MouseListener

More information

Q&A集

Q&A集 MapViewer & ver.2 EWEB-3C-N055 PreSerV for Web MapViewer & i 1... 1 1.1... 1 1.2... 2 1.3... 3 1.4... 4 1.5... 5 1.6... 6 1.7... 7 1.8... 8 1.9... 9 1.10...11 1.11...12 1.12...13 1.13...14 1.14...15 1.15...16

More information

1: Preference Display 1 package sample. pref ; 2 3 import android. app. Activity ; 4 import android. content. Intent ; 5 import android. content. Shar

1: Preference Display 1 package sample. pref ; 2 3 import android. app. Activity ; 4 import android. content. Intent ; 5 import android. content. Shar Android 2 1 (Activity) (layout strings.xml) XML Activity (Intent manifest) Android Eclipse XML Preference, DataBase, File 3 2 Preference Preference Preference URL:[http://www.aichi-pu.ac.jp/ist/lab/yamamoto/android/android-tutorial/tutorial02/tutorial02.pdf]

More information

国土技術政策総合研究所 研究資料

国土技術政策総合研究所 研究資料 ISSN TECHNICAL NOTE of National Institute for Land and Infrastructure Management No256 September 2005 Experimental Study on Seismic Behavior of Seawalls for Controlled Waste Disposal Shingo KANO, Katsuya

More information

2018 IPSJ/SIGSE Software Engineering Symposium (SES2018) 1,a) 1,b) 1,c) Java 2014 Java Java Java Stream Optional 18% Stream 5% Stream JDK6/7

2018 IPSJ/SIGSE Software Engineering Symposium (SES2018) 1,a) 1,b) 1,c) Java 2014 Java Java Java Stream Optional 18% Stream 5% Stream JDK6/7 1,a) 1,b) 1,c) Java 214 Java Java Java 1 13 3 Stream Optional 18% Stream 5% Stream JDK6/7 Java Stream Optional 1. [1], [2], [3] [4] 2 1 a) h-tanaka@ist.osaka-u.ac.jp b) shinsuke@ist.osaka-u.ac.jp c) kusumoto@ist.osaka-u.ac.jp

More information

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; 19 3!!...... (+) (>) (++) (+=) for while 3.1!! 3.1.1 50 20 20 5 (20, 20) 3.1.1 (1)(Blocks1.java) public class Blocks1 extends JApplet { public void paint(graphics g){ 5 g.drawrect( 20, 20, 50, 20); g.drawrect(

More information

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 More Logic More Types ML/OCaml GADT Jacques Garrigue ( ) Jacques Le Normand (Google) Didier Rémy (INRIA) @garriguejej ocamlgadt ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 ( ) ML type nebou and

More information

US40cユーザーズガイド

US40cユーザーズガイド US40c 1 Enter CURRENT Passord:? _ InsydeH20 Setup Utility Main Advanced Security Boot Exit Video Configuration Poer Save Quick Charge HDD [2GB ATA Flash

More information

中小企業の発展と政策支援

中小企業の発展と政策支援 1 2 2 3 5 6 10 12 13 14 16 19 20 21 ODA Official Development Assistance IT Information Technology 80 1 2 IT 3 1980 IT 70 IT 4 99 66 53 68 55 51 45 5 6 7 8 9 1971 1979 enterprise 10 1997 18 SBS 2000 SBS

More information

;y ;y ;; yy ;y;; yy y;y;y;y ;y; ;; yy ; y Portable CD player Operating Instructions RQT5364-S

;y ;y ;; yy ;y;; yy y;y;y;y ;y; ;; yy ; y Portable CD player Operating Instructions RQT5364-S ;y ;y ;; yy ;y;; yy y;y;y;y ;y; ;; yy ; y Portable CD player Operating Instructions -S + - + - 1 3 K 2 - + H K Ni-Cd A.SHOCK S-XBS HOLD HOLD HOLD HOLD ( 1; 1; 6 VOLUME 5 4 1; A.SHOCK S-XBS RANDOM NOR

More information