The other day I found this blog post on using GADTs to write more usable C style Haskell with effects, references and loops.  I couldn't get the example to typecheck without unsafe code, so I decided to write my own version.  I wanted the behavior of expressions and operators to be similar to that of C.  This is what I came up with: swap(r1, r2) = function $ do { z <- auto undefined; z =: r1; r1 =
ãã㯠Haskell Advent Calendar 2011 ã®5æ¥ç®ã®è¨äºã§ãã å»å¹´ãæ¸ãã¾ãããããã®è¨äºã¯ãã¡ã â Haskellå¨ã6å¹´ãã£ã¦ã俺ãOCamlãä»äºã§2ã¶æ使ã£ã¦ã¿ã - keigoiã®æ¥è¨ å æ¥ã®è¨äº Haskellï¼ã¿ã°ã¬ã¹ãªåä»ãDSLã§æ¥½ã ï¼Cè¨èªã³ã¼ãçæ - keigoiã®æ¥è¨ ãã¡ãã£ã¨ãã©ãã·ã¥ã¢ãããããååã¯ã³ã¼ãã«ã¤ãã¦ã¯å ¨ã説æããªãã£ãã®ã§ãæ¹ãã¦è§£èª¬ããã ãããã HaskellãOCamlãªã©ã®é¢æ°åè¨èªã¯ãããã°ã©ãã³ã°è¨èªã®å¦ç â æ§æ解æã¨ã³ã¼ãçæ â ãã¨ã¦ãå¾æã ã 大æã®ã½ããã¦ã§ã¢ä¼æ¥ã¨ãã¦ç¥ããã NTTãã¼ã¿ãæ¢åã³ã¼ãã®å¦ç (æ§æ解æããªãã¼ã¹ã¨ã³ã¸ãã¢ãªã³ã°) ã®ããã« Haskell ã使ã£ã¦ããããã ã (å½æ°ããã°ã©ãã³ã°ã®éã2011ãããã¤ã³ãã«å¤æ³¨ããé¨åããããã togetter 1
é¢æ°åããã°ã©ãã³ã°è¨èªã¨ã³ã¼ãçæ HaskellãOCamlãªã©ã¯ã³ã³ãã¤ã©ãªã©ã®è¨èªå¦çç³»ã®å®è£ ãå¾æã¨ãã¦ããããããã«æ¥å¸¸çã«ã³ã³ãã¤ã©ãå®è£ ãã¦ãã人ã¯ããå¤ããªãã¨æããã©ãä¾ãã°ã³ã¼ãèªåçæã¯ãã試ããå²ã«å¹ãç®ã大ãããä»äºãå¹çåããæ¹æ³ã¨ãã¦ãã²è©¦ãã¦ã¿ããé¸æè¢ã ã ä»åã¯ãHaskellã®è¨èªå DSLããCè¨èªã®ã³ã¼ããçæããæ¹æ³ï¼ã®ä¸ã¤ï¼ãç°¡åã«ç´¹ä»ããã ãã®æ¹æ³ã§ãHaskellä¸ã®EDSLã使ã£ã¦ (1) Cè¨èªã®ã½ã¼ã¹ã³ã¼ããçæã§ãã (2) Haskellã®å¼ã¨ãã¦è©ä¾¡ã§ããã ãã®ããã«ããããããã¼ãµãæ¸ããªãã¦ããã³ã³ããã¼ã¿ãé©å½ã«ä½ãã°ããã«DSLãä½ã£ã¦ãã¾ããã®ããé¢æ°åè¨èªã®é åãããããªãã taglessãªæ¹æ³ ãã ããã¡ãã£ã¨ä»ã¨éãæ¹æ³ã試ãã Olegããã®ãµã¤ãã«Typed Tagless Interpretation
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}