You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Purely functional, elegant, correct, incremental and composable stream processing that is CPU and memory efficient. This is our (worthy) goal, but where do we start? This problem space is being extensively explored across a variety of languages and libraries, each with subtly different trade-offs and not-so subtly different APIs and terminology. However, these libraries share common goals, and mos
Pancito is a Haskell module for manipulating functional images and then saving them to disk. It was inspired by Pan. You might be best starting with the Introduction to Pancito. Pancito 2.2 adds better output code (tiling, progress meter) and type classes to Pancito 2.1. These changes make my life easier as I develop new images. It also has a couple of extra extensions to support images of pixella
Animating Web UI with React and HaskellJoel Burget Posts Animating Web UI with React and Haskell The last few weeks I've been working on adding animation support to React-Haskell. I consider animation an unsolved problem in the React world, and Haskell is only just beginning to be used for web UI, so this project is breaking challenging new ground. Here I'll explore what I've learned, give some fu
今までいまいちモチベが上がらなかったHaskellでスクリプトを書くというのが、急に現実的になってしまったので、紹介します。 Haskellでスクリプティングする上での問題点 Haskellはもともと簡単なテキスト処理を書きやすいプログラミング言語ではあるのですが、標準で提供されているライブラリはあまり多くないので、必要に応じてコミュニティーパッケージを導入しなければその力を存分に発揮することができません。 通常のパッケージなら、cabalに依存関係を書けばパッケージマネージャで自動的に(コケることもありますが、理想的には)管理できるのですが、シェルスクリプトやPerl、あるいは最近ならPythonでやるような、コードを直接インタプリタで実行するような形のコードでは、そのような依存関係を自動で解決することは難しく、その上、仮にやろうとしたところで、いつまでもその依存パッケージが新しいコンパ
あらすじ Web技術が複雑になる中で、JavaScriptのプロファイリングをとる方法とは。 プロファイリングを取るためのコードを手で書いてみましょう。 とてもシンプルで、かつ最高のJavaScriptプロファイラ sjsp を作りました。 本当にあった怖い話 上司 「とにかくJavaScriptのコードを速くしてくれ」 私 「分かりました、速くします」 (次の日) 私 「いいプロファイラがないなら作ればいいじゃない」 同じチームの人 「えっ?」 私 「最高のJavaScriptプロファイラ作ったよ」 同じチームの人 「「えっえっ???」」 私 「早速使ってみたらこことここが遅いって分かったよ」 同じチームの人 「「「この子は一体…」」」 JavaScriptのプロファイリングの難しさ 近年、Webブラウザーの処理速度は著しく向上し、その可用性の高さから、アプリケーションのプラットフォーム
Haskellの型クラスは、うまく使えば高いパフォーマンスと抽象度を両立できる、優れた仕組みである。その使い方のコツは、決して理解の難しいものではない。 小さな性質、大きな恩恵 プログラマは大きなものを小さく見せがちだ。オブジェクト指向プログラミングに慣れている人がやりがちなアンチパターンとして、欲しい機能と、それを分割する基準が現実に寄りすぎていて、一つ一つが巨大というものがある。 普通のプログラミングではありえない例かもしれないが、たとえば家を作りたいことを考える。「ベッド」「箪笥」「台所」「冷蔵庫」「トイレ」「風呂」のように設備ごとに分けた抽象化をしたいと考えるだろう。確かにこれは理に適っているように見える。だが、これらの設備を型クラスでまとめるのは悪手だ。 風呂やトイレには水を利用できるという性質が、冷蔵庫には電気が必要だ。部屋と部屋は壁で仕切られ、場合によっては扉があるかもしれな
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? Stackとは? つい先日のことですが、Stackage界隈からstackというツールがリリースされました。リリースされたとはいえ、開発され始めたのがちょっと前のことですし、現在も盛んに機能が追加されているので、絶賛開発中であるとかそういったほうがいいかもしれません。 まだ開発の始まったばかりのツールなのに、なぜこんな紹介記事を書こうと思ったのかというと、このツールがHaskellの開発において極めて有用になることが確定的に明らかであって、すでに荒削りながらも、大変便利に使えているからなのです。そしてここで紹介することで、多くの読者の方
継続モナドって何に使うんだ問題に対する一つの例。 リソース管理の問題 プログラミングをやっていると必ずまとわり付いてくるのがリソース管理の問題です。ここで指すリソースというのは、ファイルのハンドルだとか、ソケットだとか、排他処理のためのロックだとか、グラフィックのハンドルだとかそういう話で、GCのない言語だとメモリの管理もこれに含まれるでしょうか。 言うまでもなく、リソースを確保した後はしかるべきタイミングで確実に解放してやる必要があります。しかし往々にして、現実のプログラムではリソースの解放漏れが発生してしまいます。単に解放するコードを書き忘れると言うのが一番単純でしょうもない理由ですが、それでも、C言語のようにリソース解放のための特別な仕組みを持たない言語では、これを徹底するのも結構骨の折れることだったりします。それはともかく、もう少し高尚な悩みとしては、例外との組み合わせで発生する解
使いやすさを目指したコマンドラインパーザー、optparse-declarativeというのを作りました。 これは何ですか? コマンドラインオプションを解析して、しかるべき処理を呼び出すためのライブラリです。ちゃんとした機能を備えたコマンドラインパーザーを、とにかく書きやすい形のAPIで提供することを目指して作っています。 コマンドラインパーザーっていうのは、プログラム全体のライフライクルから考えると、いじっている時間は決して長いわけではないので、新しいプログラムをつくろうかとなった時に、はてどうやってライブラリを使うのだったんだろうかと毎回忘れてしまいます。それでもって、それがわかりづらいものだと、その思い出すという事自体がわりと心理的障壁になってしまったりしていけないと思って、そういうところを目指したものを作りました。宣言的で型レベルとタイトルに入っていますが、簡単さを目指していたら勝
While writing the source code of a 3D engine, we can have many types of problems. These may range from simple problems of code that will not compile, to harder problems like memory leaks. At IMVU, we have automated solutions in place to help find these kinds of problems. For example, unit testing combined with Valgrind has helped us track down a lot of memory leak problems. But what about performa
6月9日に FP Complete から stack コマンドがリリースされました(公式ブログ)。とりあえずブログ1文目を訳すとこんな感じです。 stack は新しく、完璧で、クロスプラットフォームで動作する開発ツールで、新参も古参も対象にしていて、コンパイラーをインストールしてセットアップして、必要なパッケージをインストールして、ビルドして、プロジェクト内の1つ以上のパッケージのテストをするもしくはベンチマークを取るためのものです。 stack is a new, complete, cross-platform development tool aimed at both new and experienced Haskell developers alike, for installing and setting up the compiler, installing package
What is PeaCoq? Over the past year, I have developed a Coq frontend called PeaCoq (not to be mistaken with Yves Bertot’s Pcoq). If you wish to play with it before or while reading this article, I made an online version available here. Note that it will reset after 15 minutes of inactivity, and that it might go down any time! There have been several attempts at improving user interfaces for proof a
{-# LANGUAGE QuasiQuotes #-} import qualified Language.C.Inline as C sigma :: C.CInt -> IO C.CInt sigma x = [C.block| int { int i, ret = 0; for (i = 1; i <= $(int x); i++) ret += i; return ret; }|] main :: IO () main = print =<< sigma 10 inline-cでは、QuasiQuoteでCのコードをHaskellに埋め込むので、LANGUAGEプラグマでこれを使えるようにしないといけません。sigmaという関数は、ご覧のとおり、引数xに対して、1からxまでの和を計算する関数です。基本的にCで普通に書けばいいのですが、$(<型名> <変数名>)などのunquote
General-Purpose Text-File Templating Utility λtext is a generic templating tool for any text file. For languages that don't support import-style code-reuse, it's common to just copy/paste. However, after a change is needed, that change must be replicated manually to every file needing it. With λtext, you parameterize the files themselves, and let λtext do the pasting. With Lambda Calculus as the u
A command line tool for using Haskell code as a command line filter. It is also useful for prototyping Haskell text processing functions that you will later copy into a program. Why is eddie? This project actually started in response to a code bounty for a clojure shell scripting tool. That resulted in a specification for the requested program that had all the features of eddie, and then some. How
haskellscript: Command line tool for running Haskell scripts with a hashbang. This tool provides the ability to script in a shell with Haskell (including dependencies) the same way that has been possible with bash scripts or Python. Examples Print out JSON constructed with Aeson https://github.com/seanparsons/haskellscript/blob/master/Example.hs Lookup weather for your current IP address https://g
hArduino allows Haskell programs to control Arduino boards and peripherals, using the Firmata protocol. Important Note: The Firmata project has moved on since hArduino was released, and their latest protocol implementation does not work with hArduino. Please use the following (slightly older) copy for hArduino: Standard Firmata. See also instructions below. On Hackage (v1.2): hArduino. (Released:
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く