IBM Developer is your one-stop location for getting hands-on training and learning in-demand skills on relevant technologies such as generative AI, data science, AI, and open source.
Posted on March 30th, 2013. If you ignore the practical issues of computers like size, weight, cost, heat, and so on, what do you really need in a programming language? Let's play around with this question. To understand this post you'll need a basic understanding of how functions in Javascript work. If you can look at this code and understand what it prints, you're good to go: var x = 10; var f =
å¤ãè¯ãå°å¦æ ¡ã®æ代ããã®è¡ã«ã¯å°æããããããã®ã ã£ãã éè¡ç㪠x ããå ç®ãããã®ã«çããã¾ã¾ã§ããäºã«ã ã©ãããããããããã°ã©ãã³ã°ãå§ããã¨ãããã«æ§ããªããªãã ããããããããã¯é大ãªäºæãããªãããããã°ã©ãã³ã°ã¨ã¯ç¾å®ã®ãã¸ãã¹è¡çºãªãã ããã æ°å¦çãªç´ç²ãã«ã¤ãã¦ããæ¢ããªãã¦å¿ è¦ç¡ã (ãã®è°è«ãªãã大å¦ã«ããçã£ãé«é¢ééã©ãã«ããã¦ããã°ãã)ãã¨æã£ã¦ããã ããã©ãããã ç¥ããªãã£ãã ãã§ãæã ãééã£ã¦ãã¦é«ã代åãæ¯æã£ã¦ããã®ã¯ æããã§ããã Wikipedia ã«ããã°ããé¢æ°åããã°ã©ãã³ã°(functional programming, FP)ã¨ã¯ã è¨ç®ãæ°å¦çãªé¢æ°ã®è©ä¾¡ã¨ã¿ãªãã ç¶æ ãå¯å¤ãã¼ã¿ãé¿ããããã°ã©ãã³ã°ãã©ãã¤ã ãã§ããã è¨ãæããã¨ãé¢æ°åããã°ã©ãã³ã°ã¯ã å¯ä½ç¨ãç¡ãå¤æ°ã®å¤ãå¤åãããªãã³ã¼ããæ¨å¥¨ããã
Quicksort in Haskell Quicksort is a commonly used example of how succinct Haskell programming can be. It usually looks something likes this: qsort :: (Ord a Bool) => [a] -> [a] qsort [] = [] qsort (x:xs) = qsort (filter (<= x) xs) ++ [x] ++ qsort (filter (> x) xs) The problem with this function is that it's not really Quicksort. Viewed through sufficently blurry glasses (or high abstraction altitu
By plushoff under CC BY-NC å±±å£ããããããJavaéçºè ã®ããã®é¢æ°ããã°ã©ãã³ã°ãã®é»åç®æ¬ãããã ãã¾ããããããã¨ããããã¾ããé»åæ¸ç±ä¾¿å©ã§ãããã¢ã¡ãªã«ã«ãã¦ãæ¥æ¬èªã®æ¬ãæã«å ¥ãï¼ãããããããããªããæ¥æ¬èªã«ãªã£ã¦ãããã注éãã°ã£ã¡ãã¤ãã¦èªã¿ãããã§ããä»äºã®ã§ããç·ã®é¢¨æ ¼ãæãã¾ãã æ¬äººã®ããã°: http://ymotongpoo.hatenablog.com/entry/20120621/1340233739 ãªã©ã¤ãªã¼ã®æ¸ç±ãã¼ã¸: http://www.oreilly.co.jp/books/9784873115405/ ãã®æ¬ã楽ããèªãã§ããã¨ãããå±±å£ããããå¥ã®é¢ç½ããªã³ã¯ãæãã¦ãããã¾ããã Why OO Sucks (ãªããªãã¸ã§ã¯ãæåã¯ã¯ã½ãªã®ã) Erlangã®éçºè ã®Joe Armstrongã®è¨äºã§ããæ¬å½ã¯
The Gang of Four book introduced many a C++ programmer to the world of patterns. Those patterns are mostly based on everyday examples, although there are a few more abstract ones like Strategy. In Haskell (and other functional languages) most patterns are very abstract. They are often based on mathematical constructs; category theory being a major source of ideas. Arguably itâs easier to grok term
Probably everyone reading this has heard âfunctional programmingâ put forth as something that is supposed to bring benefits to software development, or even heard it touted as a silver bullet. However, a trip to Wikipedia for some more information can be initially off-putting, with early references to lambda calculus and formal systems. It isnât immediately clear what that has to do with writing
ããã°ã©ã ã®æ°ç æéï¼ 2008 年度å¬å¦æ æææ¥åå 8:30 -- 10:00 å ´æï¼ å·¥å¦é¨ 6 å·é¤¨ 2 é 63 è¬ç¾©å®¤ è¬ç¾©å 容 è¨ç®æ©ããã°ã©ã ã«å å¨ããæ°ççæ§é ãæããã¢ã«ã´ãªãºã è¨è¨ã«ãããæ§ æçææ³ã®ä½ç³»åã¨ããã«åºã¥ãããã°ã©ãã³ã°æ¹æ³è«ãæ±ãã ç®æ³è¨èªã®åºæ¬æ¦å¿µï¼ææ³ã»æå³ã»åã»è¨ç®ã¢ãã«ï¼ãå¦ç¿ãããã¨ã«ã㣠ã¦ãå³å¯ãªç§å¦ã»å·¥å¦ã¨ãã¦ã®ããã°ã©ãã³ã°ã®ããæ¹ãå¦ã¶ã ç®æ³è¨è¨ã»ããã°ã©ãã³ã°ãæ°å¦çãªæ´»åã¨ãã¦ã¨ãããèãæ¹ãç解ã ããè¨ç®æ©ããã°ã©ã ã®æ°ççæ§é ãæãï¼ããã«åºã¥ãã¦æ§æçã«ã¢ã«ã´ãª ãºã ãè¨è¿°ããæ§æçã¢ã«ã´ãªãºã è«(constructive algorithmics)ã®åºç¤ãæ± ãã æç§æ¸ã»åèæ¸ æ¦å¸æ£äººè¨³ã ãé¢æ°ããã°ã©ãã³ã°ã, è¿ä»£ç§å¦ç¤¾, 1994å¹´. ISBN4-7649-0181-1ãå®ä¾¡ 4,500åï¼(R.
ã¯ããã« ããã«ã¡ã¯ãPythonçã®æ å¼±ã§ããã¡ãã£ã¨åã«OCamlç³»ã®ã¨ã³ããªãè²ã ã¨çºãã¦ãããYaron Minskyæ°ã®ã¨ã³ããªãè¦ã¤ããã®ã§ç¿»è¨³ãã¦ã¿ã¾ããã OCaml for the Masses - ACM Queue Yaron Minskyæ°ã¯Jane Streetã§ç¬¬ä¸ç·ã§æ´»èºãããã¨ã³ã¸ãã¢ã§ãJane Streetã®æè¡ãã¼ã¸ãã¯ããå¤ãã®å ´æã§OCamlã«é¢ãã¦ã®ç¥è¦ãèªã£ã¦ãã ãã£ã¦ãã¾ãã Jane Street Tech Blogs æ¬ã¨ã³ããªã¯John Hughesã®åã¨ã³ããªããªãé¢æ°ããã°ã©ãã³ã°ã¯éè¦ãããåãã¦ACM Queueã«å¯ç¨¿ããããã®ã®æ¥æ¬èªè¨³ã§ãã ãªãé¢æ°ããã°ã©ãã³ã°ã¯éè¦ã Why the next language you learn should be functional YARON MINSKY, JANE STREE
eagerãªè¨èªã§ã¯foldrã¯ãªã¹ãã®é·ãã«æ¯ä¾ããã¹ã¿ãã¯ãæ¶è²»ãããGHCã§ã(+)ã®ãããªæ£æ ¼ãªé¢æ°ã§ç³ã¿è¾¼ããã¨ããã°åæ§ã«O(n)ã®æ¯ãèãã«ãªãã {-# OPTIONS_GHC -O0 #-} import Data.List(foldl') main = do n <- readLn print $ foldr (+) 0 [1..n] -- O(n)ã¹ã¿ãã¯ãO(1)ãã¼ã print $ foldl (+) 0 [1..n] -- O(n)ã¹ã¿ãã¯ãO(n)ãã¼ã print $ foldl' (+) 0 [1..n] -- O(1)ã¹ã¿ãã¯ãO(1)ãã¼ã ä¸æ¹ãfoldrã使ã£ã¦å¹ççã«å®è£ ã§ããé¢æ°ãHaskellã«ã¯åå¨ãããä¾ãã°ä»¥ä¸ã¯concatã®ç«æ´¾ãªå®ç¾©ã§ãããO(1)空éã§åä½ãã*1ã concat :: [[a]] -> [a] concat =
2011-05-28 Scalaçã®é¢æ°åããã°ã©ãã³ã°ä¸æ´¾ã代表ããè«å®¢ã®ä¸äººã@djspiewak ã 2010å¹´ã«æ¸ãã âMonads Are Not Metaphorsâ ã翻訳ãã¾ããã翻訳ã®å ¬éã¯æ¬äººãã許諾æ¸ã¿ã§ãã翻訳ã®ééãçãããã°é æ ®ãªããææãã ããã 2010å¹´12æ27æ¥ Daniel Spiewak è 2011å¹´5æ29æ¥ e.e d3si9n 訳 åã¯ä»ãç´æãç ´ãã¨ããã ããããä¸å¹´åãåã¯çµ¶å¯¾ã«ã¢ããã®è¨äºã ãã¯æ¸ããªãã¨èªåã«ç´æãããæ¢ã«ã¢ããã«é¢ããè¨äºã¯æãä½ã£ã¦ãããè¨äºã®æ°ãå¤ããã¦ãã®å¤ãã ãã§å¤ãã®äººã¯æ··ä¹±ãã¦ããããããå ¨å¡ãã¢ããã«å¯¾ãã¦ç°ãªãæ±ãæ¹ããã¦ãããããã¢ããã®æ¦å¿µãåãã¦å¦ã¼ãã¨ããè ã¯ãããªãã¼ãå®å®æã象ãç æ¼ ã®ããã¦ã£ã³ (訳注: ã¢ã©ãç³»éç§æ°) ã®å ±éé ãæ¢ãåªåããããã¡ã«ãªã£ã¦ããã åã¯ããã®æ··ä¹±ãã
é¢æ°åè¨èªshã®ææ³ä¸è¦§ã§ããä»ã®é¢æ°åè¨èªãããç¨åº¦ç¥ã£ã¦ãã人ããããèªãã°ãshã®åºç¤ããã¹ã¿ã¼ãã¦shãæ¸ããããã«ãªã£ã¦ãã¾ãã以ä¸ãClojureããããæ³å®ãã¦èª¬æãã¾ãã 注æï¼ããã¯åºç¤ææ³æéãã¹ã¿ã¼ããã®ãããã£ã§ããåä½ã¯æ¬ç©ã§ãããæå³ã¯ã³ã¸ãã±ã§ãã REPL shã®å¦çç³»ã¯ãPOSIXæºæ ã®Unixç³»ç°å¢ã§ããã°æ¨æºã§ç¨æããã¦ãã¾ããREPLãèµ·åããã«ã¯ãshãå®è¡ãã¾ãã sh ããã¨ãããã³ããã表示ããã¾ãã $ shã®ã»ãã«ãREPLã«è¡ç·¨éæ©è½ãä»ããbashã»zshã»tcshãªã©ãããã¾ãããããã§ã¯å²æãã¾ãã ãªããREPLã¨ãã¦ä½¿ãã»ãã«ããããããç¨æããã¹ã¯ãªãããshã§å®è¡ãããã¨ãã§ãã¾ãã sh hoge ã·ã¼ã±ã³ã¹ shã®æ±ããã¼ã¿ã¯ããã¹ã¦ãããåä½ï¼ã©ã¤ã³ã¨å¼ã³ã¾ãï¼ã®ãã¼ã¿ã並ãã ã·ã¼ã±ã³ã¹ã§ãããã¨ãã°ãseqé¢æ°ï¼L
This page has two purposes: to describe how to implement computer language interpreters in general, and in particular to build an interpreter for most of the Scheme dialect of Lisp using Python 3 as the implementation language. I call my language and interpreter Lispy (lis.py). Years ago, I showed how to write a semi-practical Scheme interpreter Java and in in Common Lisp). This time around the go
Monads in Perl Monads in Perl (in the spirit of TMTOWTDI) Haskell is the language that popularized (?!) monads, but my understanding was impeded because of the myriad of new things that I needed to learn about Haskell before I could even get to monads (different syntax, purity/laziness, typing system, significant white-space, etc.) All that added up to something as clear as mud. I needed a Rosetta
This article owes a great debt to Monads as Containers and A Schemerâs Introduction to Monads, each of which greatly advanced my understanding of the topic. Introduction Monads have been getting a lot of press lately in connection with the Haskell programming language. Theyâre a very powerful programming tool in functional languages, but all too often theyâre described as some sort of black magic
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}