2008-07-01ãã1ã¶æéã®è¨äºä¸è¦§
ãã£ã±ãé©å½ãªãã ãã©â¦ã strlen 1 = "one" strlen 2 = "two" strlen 3 = "three" strlen 4 = "four" strlen 5 = "five" strlen 6 = "six" strlen 7 = "seven" strlen 8 = "eight" strlen 9 = "nine" strlen 10 = "ten" strlen 11 = "eleven" strlen 12 = â¦
Opera è¨å®ã¡ã¢ãæè¿ããã¤ãã®ãã·ã³ã§ Opera ã®è¨å®ããã¦ããã®ã§ããå æ¸ãããâ¦ã ã¢ãã¬ã¹ãã¼ããã® Google æ¤ç´¢ã§ãã¼ãã¼ãã·ã§ã¼ãã«ããã使ããããã«ãã http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8&esrch=Bâ¦
ããã¼ããåæããããåé¡ã解ãå ´åã«ã¯ã³ã³ãã¥ã¼ã¿ãé å¼µããªããã°ãããªãã®ã§ãã£ã¦ã人éã¯é å¼µã£ã¦ã¯ãããªãã®ã ï¼(æå³ãéã) object Problem10 { def natural = new Iterator[Int] { var num = 1 def hasNext : Boolean = true def next : Intâ¦
Scala ã§è¶ ç´ ç´ã«æ¸ãã¦ã¿ããããæ¢ã¾ããªãããã³ãã¤ãIterator - ããªã®æ¥è¨ãåèã« Scala ã§ã¤ãã¬ã¼ã¿ã使ã£ã¦ã¿ãã object Problem12 { def divisors(n:Int) : Int = { var c = 1 var result = 0 while ( c <= n/2 ) { if ( n % c == 0 ) result +=â¦
http://blog.tmorris.net/scala-exercises-for-beginners/ ãã£ãããªã®ã§è²¼ã£ã¦ããã object Exercise { def succ(n: Int) = n + 1 def pred(n: Int) = n - 1 def add(x:Int, y:Int) : Int = if ( x == 0 ) y else add(pred(x), succ(y)) def sum(xs: Listâ¦
ããã¦ä¹ ãã¶ãã® Project Eulerãä»ã¯åç´ä½æ¥ãªãä»äºã°ãããã£ã¦ããã®ã§ããºã«ã§æ°å転æã isEquiv [] [] = True isEquiv (x:xs) ys | elem x ys = isEquiv xs $ filter (/=x) ys | otherwise = False isEquiv _ _ = False isOK x = let (n:ns) = map â¦
Agda ã¨ãããä¾ååã(主ã«èªåã®å¨ãã§)æµè¡ã£ã¦ãããid:yoshihiro503 ããã Agda ã«ã¯ã¾ã£ã¦ãã¦é ¼ãããæããªã®ã§ããããæãã¦ããããã°ã¨æãã¾ãã
ã©ããã Agda2 ã¯ã¾ã 主æµãããªã(?)ãããªæããªã®ã§ãã¾ã㯠Agda1 ã触ã£ã¦ã¿ããã¨æã£ãããã£ã¡ãªããã¥ã¼ããªã¢ã«ã¨ããå°ãã¯ããããã¨ãããããããã®åæ©ã®è«æã§ã¯ Agda1 ã使ã£ã¦ããâ¦ã(æåã«æ°ã¥ãã¨ãã)
Agda2 ã¾ãããããªããå¿æããããã¨ãããã agda-mode ã§ä½¿ãæ¹ãããã£ããã¤ãé©å½ ã¡ã¢ããã®ãã¡è¿½å ãã¾ãã C-c C-x C-l agda ã§è¨¼æãéå§ã ? 証æãããããããªãã¨ãã㯠? ã§åããã assoc x y z = ? ãã㧠C-c C-x C-l ã¨ãã㨠? ãã´ã¼â¦
ãªã¨ãã«ãã§ãã証æãããããã£ã¦ãªããã¾ã filter ã®å®ç¾©ã filter : forall {a} -> (a -> Bool) -> [ a ] -> [ a ] filter p [] = [] filter p (x ∷ xs) with p x ... | true = x ∷ filter p xs ... | false = filter p xs ã§ã証æã modâ¦
http://commonsmarker.com/ã£ã¦ããã®ããããã(http://idm.s9.xrea.com/ratio/2008/07/08/000789.htmlããçµç±) ããã¨ã¾ã£ããåããã®ãä½ããã¨ãã¦ããã¾ãã(ã»ã¨ãã©æã¯åããã¦ã¾ããã)ããã¼ã¯ãä»ããå ã¯ã¦ã§ããããªãã¦è«æpdfã®ã¤ããã§ãâ¦
Agda ãåå¼·ä¸ã§ããããããåå¿è ãã¼ã¯ã§ããã©ããã®ãã¥ã¼ããªã¢ã«ã«è¼ã£ã¦ããã®ã³ã¼ããéããªãã®ã§å°ããæå¾ã® odd k ã®åãåããªããããã ã㨠dotted pattern ã£ã¦ããã®ããã¾ãã¡ç解ã«èªä¿¡ããªããåããå¤ãããããããªä»®å¼æ°ã«ã¤ããã£â¦
summer school library ã£ã¦ããã®ã使ã£ããåãã¾ããããã¨ã§ã©ã¤ãã©ãªã®ã³ã¼ããèªã¾ãã°ã module Views where open import Data.Nat data Parity : ℕ -> Set where even : (k : ℕ) -> Parity (k * 2) odd : (k : ℕ) -> Parity (1 +â¦
ãã¾ãããã£ã¦ãªããã©ãã¨ããããããã¤ãé©å½ãªé¢æ°ãæ¸ããã®ã§ã¡ã¢ãä¾ååããã(æ°ããã)ã agda2 ã® emacs ã¢ã¼ãã使ãããªããªãã®ã¨é¢æ°ãå®è¡ããæ¹æ³ãããããã®ãåé¡ã§ããã module NList where data Nat : Set where zero : Nat succ : â¦