Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
I see this code in this blog: Type-Level Programming in Scala: // define the abstract types and bounds trait Recurse { type Next <: Recurse // this is the recursive function definition type X[R <: Recurse] <: Int } // implementation trait RecurseA extends Recurse { type Next = RecurseA // this is the implementation type X[R <: Recurse] = R#X[R#Next] } object Recurse { // infinite loop type C = Rec
ãã¢ããã¯è±¡ã (Monads are Elephants)ãæ¥æ¬èªè¨³Â¶ ãã®æç« ã¯ã以ä¸ã®è¨äºã®ç¿»è¨³ã§ãã Monads are Elephants: http://james-iry.blogspot.com/2007/09/monads-are-elephants-part-1.html http://james-iry.blogspot.com/2007/10/monads-are-elephants-part-2.html http://james-iry.blogspot.com/2007/10/monads-are-elephants-part-3.html http://james-iry.blogspot.com/2007/11/monads-are-elephants-part-4.html JAMES IRY:ONE DIV ZERO: http://james-iry
ããã¾ã§ã®èª¬æã§ç°ãªãã³ã¬ã¯ã·ã§ã³ãç°ãªãæ§è½ç¹æ§ (performance characteristics) ãæã¤ãã¨ãåãã£ããæ§è½ç¹æ§ã¯ã³ã¬ã¯ã·ã§ã³åãæ¯è¼ãã第ä¸ã®åºæºã¨ãã¦ãã使ãããã以ä¸ã® 2ã¤ã®è¡¨ã«ã³ã¬ã¯ã·ã§ã³ã®ä¸»ãªæ¼ç®ã®æ§è½ç¹æ§ãã¾ã¨ããã ååã®æ§è½ç¹æ§: head tail apply æ´æ° å é ã«è¿½å æå¾ã«è¿½å æ¿å ¥
Scaladoc¶ å ¨ã¦ã®ããã±ã¼ã¸ï¼ã¯ã©ã¹ï¼ãã¬ã¤ãï¼ã¡ã½ããï¼ãã®ä»ã®ã¡ã³ãã«ããã¥ã¡ã³ããæä¾ãããã¨ã¯ã¨ã¦ãéè¦ã§ããScaladocã¯ä¸è¬ã«Javadocã®æ £ç¿ã«å¾ãã¾ããï¼è¨è¿°ãç°¡æ½ã«ãã¾ããããã®æ©è½ãå¤æ°è¿½å ããã¦ãã¾ãã æ®éã¯ï¼æ¸å¼ããããã®å 容ãæ¸ãæ¹ãæ°ã«ãããã¨æãã¾ããScaladocã¯çµé¨è±å¯ãªã¦ã¼ã¶ã¨åæ§ã«åå¿è ã«ã便å©ã§ç¡ãã¦ã¯ãªãã¾ããããã®ç®çãéæããæ¹æ³ã¯ã¨ã¦ãåç´ã§ããããªãã¡ï¼èª¬æã®è©³ç´°åº¦ãä¸ãã¦ï¼ç°¡æãªè¦ç´ããå§ãï¼çéããã¦ã¼ã¶ã®åèã¨ãã¦æçã§ãï¼ï¼è©³ç´°é¨ã§ã¯ããä¸å¯§ãªä¾ï¼çç·´è ã¯ç¡è¦ããããããã¾ãããï¼åå¿è ã«ã¯ä½ãããè²´éãªãã®ã§ãï¼ãæä¾ãããã¨ã§ãã Scaladocã®ä¸è¬çãªæ¸å¼ã¯æ¬¡ã®æ§ãªãã®ã§ãã /** * ããã¯ä½ã説æãããã¨ãã¦ãããã®ç°¡æ½ãªè¨è¿°ã§ãã * * ããã¯æã ãããã¥ã¡ã³ãåãããã¨ãã¦ãããã®ãæ´ã«è¨è¿°
ãªãããæ å ±ã ããã©ãã©è¦ããã¦ãã¦æ°ã«ãªã£ã¦ããã®ã§ãã¾ããååãããFutureã®æã«ä½¿ã£ã¦ããã®ã§ããã Try Futureã®çµæã¨ãã¦ä½¿ã£ã¦ãããSuccessã¨Failureã®è¦ªã¯ã©ã¹ã§ããSuccessãæåãFailureã失æã表ãããã§ãããFailureã¯ä¾å¤ãæ å ±ã¨ãã¦æã¡ã¾ãããã以å¤ã¯Successã§ãã¨ã Futureã®æã¯ãè¨ç®çµæãSuccessã¾ãã¯Failureã¨ãã¦å¾ããã¾ãããããããåç¬ã§ä½¿ãå ´åã«ã¯Tryã³ã³ãããªã³ãªãã¸ã§ã¯ãã®applyã¡ã½ããã使ç¨ãã¾ãã println(Try { 10 }) // => Success(10) println(Try { throw new Exception("Oops!") }) // => Failure(java.lang.Exception: Oops!) Try.applyã®ã·ã°ããã£ã¯
Scalaã®Webãã¬ã¼ã ã¯ã¼ã¯äºæ 2015å¹´ç - ããããçæ»ããã° Scalaçéã®Webãã¬ã¼ã ã¯ã¼ã¯ãJsonã©ã¤ãã©ãªã¯è¯ããæªããæ··æ²ã極ãã¦ãã(?)ããã§ãããããã«ãã¦ã竹添ãããç´¹ä»ãã¦ããã¤ã ãã§ã¯å人çã«ä¸å ¬å¹³æã¨ããããæ··æ²ã¨ãã¦ããæãå ¨ç¶ä¼ãããªãã¨æã£ãã®ã§ãå ¨é¨ã«è©³ãã訳ã§ã¯ãã§ãããèªåãªãã«ç¾ç¶ãæ¸ããããªã£ãã®ã§ç´¹ä»ãããã¨æãã¾ãã ã©ããå ¨é¨ãæ¬å½ã«ç¥ãå°½ããã¦ãã人ãªãã§ããªãã®ã§ãããã¯ããã§ä¸å ¬å¹³ã¨ãããåã£ãè¦æ¹ã«ããªã£ã¦ãããããã¾ãããããããªãã¨è¨ã£ã¦ããããããè¨äºããã¤ã¾ã§çµã£ã¦ãæ¸ããªãã®ã§ãæãåã£ã¦æ¸ããã¨ã«ãã¾ããã ãã¤ãã®æ³¨ææ¸ãã§ãããããã¾ã§ããæ¸ãã¦ã2015å¹´10æç¾å¨ã®ç¶æ³ã§ããã1å¹´ç¨åº¦çµéããã ãã§ç¶æ³ã¯åçã«å¤åããå¯è½æ§ããã®ã§ããäºæ¿ãã ããã ããããããã¾ãããããã®æ¸ããããªãã®ã¯ããã
Posted on 2014-01-28 tags: scala, oop ãªãã¸ã§ã¯ãæåã¨ãã¹ãã«ã¤ã㦠ç§ã¯ãªãã¸ã§ã¯ãæåãç¹ã«èªåãã¹ãå¨ãã®å®åçµé¨ã«ä¹ããããã§ãããæè¿ã«ãªã£ã¦ãããããã¹ãããã¡ãã¨æ¸ããããã¹ããã¡ã¼ã¹ãã«ãã£ã¦è¯ãè¨è¨ã«ãªãã¿ãããªå®æãå¾ãããã¦ãã¾ããé·ãããã¹ããæ¸ããªãæåã«ããã®ã§ã注æããªãã¨ããã«ã¢ããªã·ãã¯ãªè¨è¨ã«ãªã£ã¦ãã¾ããå¾ããããã¹ãæ¸ãã®ã©ãããã ãããã¿ããã«ãªã£ã¦ãã¾ããã¨ãå¤ãã ã§ãæè¿ Dependency Injection ã¨ããä¾åæ§ããã¾ããã¨æ½è±¡åãã¦ããä»çµã¿ã«ã¤ãã¦å¦ãã ã®ã§ããã® Scala ã«ããã代表çãªãã¶ã¤ã³ãã¿ã¼ã³ã§ãã Cake Pattern ã§å®è£ ãã話ã§ãã Dependency Injection ä¾åæ§ã®æ³¨å ¥ã¨ã訳ããããä¾åãã¦ãããªãã¸ã§ã¯ããç´æ¥ã¯ã©ã¹ã®ä¸ã«æã£ã¦ããã®ã§ã¯
Frequently asked questions, with brief answers and/or links to longer answers. This list only includes questions that actually come up over and over again in Scala chat rooms and forums. General questions Where can I ask Scala questions? See our Community page. Whatâs a good book about Scala? Our Books page lists a few especially popular, well-known books. We donât have a list of all the Scala boo
Metascala is a tiny metacircular Java Virtual Machine (JVM) written in the Scala programming language. Metascala is barely 3000 lines of Scala, and is complete enough that it is able to interpret itself metacircularly. Being written in Scala and compiled to Java bytecode, the Metascala JVM requires a host JVM in order to run. The goal of Metascala is to create a platform to experiment with the JVM
refactor.scala �P ��U ��U def index(id:String) = Action { getFirstData(id) } private def getFirstData(id:String) = { Cache.get(id) match { case Some(id2) => getSecondData(id2) case None => NotFound } } private def getSecondData(id2:String) = { Cache.get(id2) match { case Some(result) => Ok(result) case None => NotFound } } sample.scala Pu���U �����U def index(id:String) = Action { Cache.get(id)
ç¬ç¿ Scalaz ããã¾ã§ããã¤ã®ããã°ã©ãã³ã°è¨èªãç¾ã®è¡£ãçã Lisp ã«å©ããããã ããã? Java ã¯é¦´æã¿è¦ªããã C++ ã®ãããªææ³ã« GC ãæã¡è¾¼ãã ãããã¾ã§ä»ã«ã GC ãè¼ããè¨èªã¯ãã£ããã©ããç¾å®çã« C++ ã®ä»£æ¿ã¨ãªãããè¨èªã« GC ãè¼ã£ããã¨ã¯ 1996å¹´ã«ã¯ç»æçã«æããããããã¦æã¯çµã¡ã人ã ã¯èªåã§ã¡ã¢ãªç®¡çãããªããã¨ã«æ £ãã¦ãã£ããJavaScript 㨠Ruby ã®ä¸¡è¨èªããã®ç¬¬ä¸ç´é¢æ° (first-class function) ããããã¯æ§æãæã¤ãã¨ããç¾ã®è¡£ãçã Lisp ã¨å¼ã°ãããã¨ããããSå¼ã®åå³åæ§ããã¯ãã«é©ãããã¨ãã Lispç³»ã®è¨èªã¯ã¾ã é¢ç½ãã¨æãã è¿å¹´ã®è¨èªã¯ããå°ãæ°ããé¢æ°åè¨èªããæ¦å¿µãåããããã«ãªã£ã¦ãããåæ¨è«ããã¿ã¼ã³ãããã³ã°ã¯ ML ã«ããã®ã¼ããã¨ãã§ããã¨æããæãçµã¦ã°ã人
Mark Harrah è Eugene Yokota 訳 ã¯ããã« å¤ã¯ã©ã¹ (value class) ã¯å®è¡æã®ãªãã¸ã§ã¯ãã®å²ãå½ã¦ãåé¿ããããã® Scala ã®æ°ããæ©æ§ã ã ããã¯æ°ãã«å®ç¾©ä»ãããã AnyVal ã®ãµãã¯ã©ã¹ã«ãã£ã¦å®ç¾ãããã ãã㯠SIP-15 ã«ã¦ææ¡ãããã 以ä¸ã«æå°éã®å¤ã¯ã©ã¹ã®å®ç¾©ã示ã: ããã¯ãã 1ã¤ã®ãpublic 㪠val ãã©ã¡ã¼ã¿ãæã¡ããããå é¨ã§ã®å®è¡æã®ãã¼ã¿æ§é ã¨ãªãã ã³ã³ãã¤ã«æã®å㯠Wrapper ã ããå®è¡æã®ãã¼ã¿æ§é 㯠Int ã ã å¤ã¯ã©ã¹ã¯ def ãå®ç¾©ãããã¨ãã§ããããvalãvarãã¾ãã¯å ¥ãåã® traitãclassãobject ã¯è¨±ãããªã:
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}