Abstract for English readers: This article describes an implementation of a purely functional, monadic parser combinator library in PLT Scheme. With this library, one can easily build non-ambiguous, recursive-descent style parsers for string of characters, input port, or even list of tokens generated by a separate lexer process. To accomodate parse failure, i.e., to perform backtracking, this libr
id:syd_sydさんにモナドについて教わって、ようやくStateモナドを理解できたのでとりあえずSchemeで書いてみた。出力(?)と状態の組は多値で表現。 (define (>>= m f) (lambda (s0) (receive (a s1) (run-state m s0) (run-state (f a) s1)))) (define (run-state m s) (m s)) (define (return a) (lambda (s) (values a s))) (define (get) (lambda (s) (values s s))) (define (put s) (lambda (_) (values #f s))) (define-syntax doM (syntax-rules (<-) [(_ (x <- m) rest ...) (>>= m (
Python は最近人気のスクリプト言語です。 Python の魅力はシンプルな文法と、拡張性の高さでしょう。 Python はちょっとしたスクリプトを書くのにも、大規模なプログラムを書くにも適した言語です。 最近の Version は日本語にも完全に対応し、日本でも愛用者が増えていると思われます。 Web 上で見当たらなかった文書やスクリプトを書いて公開しています。 特に Tkinter について詳しく書いてあります。 Python メモ Perl, Python, Ruby の比較 Python 早めぐり xyzzy から pydoc を使う wxPython でお気軽 gui。 wxPython と Tkinter で Eight Queens を作る Python のクラスシステム Python を使った FTP アップロード Python の”新しい”クラス Python 2.5
つーか、fold の弱点として、言語によって引数の順番がまちまちで、 正直憶えきれないってのがあるんだよな。誰か対応表とか作ってくれんもんか。 jijixi's diary - fold, map, for-each この中から一つ選ぶとしたらどれ? 確かにいろいろとややこしいのでまとめてみました。 いくつかの言語について大雑把に表にすると次のような感じ。 言語 関数 Haskell, OCaml, Scheme, Erlang foldl* f init items C++ accumulate(begin, end, init, f) Ruby*, JavaScript items.inject(init, f) Python, Perl* reduce(f, items [, init]) 言語 畳み込む二項演算 Scheme(SRFI)*, Erlang f(item, acc)
By Xah Lee. Date: 2002-02-28. Last updated: 2022-01-01. A Lambda Logo Tour (and why LISP languages using λ as logo should not be looked upon kindly) Dear lispers, The lambda character λ, always struck a awe in me, as with other mathematical symbols. In my mind, i imagine that those obscure math symbolism are etched in stone by god. A salient example is the book cover Concrete Mathematics by Ronald
I was originally writing a much more ambitious post that tried to introduce category theory and its uses, but have been having a hard time writing it. Unfortunately it is not something that I think can be easily explained tersely, although my attempts to do so have lead me to learn a lot more about category theory than I thought I’d ever want to know. Yet, I would still like to expose monads in a
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く