タグ

Haskellとbytestringに関するnsyeeのブックマーク (6)

  • bytestring-read

  • Reading files from the proc filesystem

    Yesod is a Haskell web framework for productive development of type-safe, RESTful, high performance web applications. July 27, 2014By Michael SnoymanView source on Github I was stumped by this one myself for a bit today, so I thought writing it up in a blog post would be a good way to make sure (1) I don't forget this little fact, and (2) hopefully the next person doesn't need to puzzle over this

  • Haskell Tips (文字列編) - りんごがでている

    この記事はHaskell Advent 2012のための記事です。(遅れてすいません(ヽ´ω`)) Haskellで実際にプログラムを書く上では、様々なパッケージにある型や関数を利用するのが不可避になります。 そういった便利ツールのうち文字列まわりについて調べたところを、Haskell最近始めたって人に紹介するのがこの記事の目的です。Haskell詳しい方には新しい発見は無いかもしれません。ごめんなさい。 この記事では、主に文字列に焦点を当てていますが、そのうちまた別のテーマでも書こうと思っています。 なお、前提としてるバージョンはHaskell Platform 2012.4.0.0と、それに付随するGHCやパッケージです。 OSも、Mac OS XやLinuxなどUNIX系の環境を想定しています。Windowsは持ってませんのでわかりません。ごめんなさい。 文字列 Haskellでは文

    Haskell Tips (文字列編) - りんごがでている
  • ByteString あれこれ - あどけない話

    Haskell で高速なプログラムを書くには ByteString の深い知識が必要となる。鍵となるのは、Data.ByteString.Internal というモジュールである。このモジュールは公開されているが、ドキュメントは隠されているので、詳しく知るためにはソースを読まないといけない。 定義 ByteString の定義は以下の通り。 data ByteString = PS {-# UNPACK #-} !(ForeignPtr Word8) -- payload {-# UNPACK #-} !Int -- offset {-# UNPACK #-} !Int -- length なぜ構成子が BS ではなく、PS なのだろう? (追記:元々 PackedString という型名だったからと @ma0e さんに教えて頂きました。) ForeignPtr Word8 は、いわゆるバ

    ByteString あれこれ - あどけない話
  • 詳解bytestring - maoeのブログ

    というタイトルでbytestringパッケージの包括的ガイドを書こうと思ったけど、まさにそんな内容のスライドをbytestringのBuilderを書いた人が公開していたのを見つけてしまったので、是非そちらを見て欲しい。 A guided tour through the bytestring library 以上、Haskell Advent Calender 2013 22日目の記事でした。 と、これで終わらせてしまってはさすがに良くないので、今回は上のスライドが作られた時点から加えられた主な変更を二つ紹介する。これらの変更は最新のリリース版GHCにバンドルされているbytestringパッケージにはまだ含まれていないので、利用したい場合は適宜cabalファイルにバージョン指定する必要がある。 ShortByteString ShortByteStringはByteStringから使え

    詳解bytestring - maoeのブログ
  • A guided tour through the bytestring library

    hello mum");doc.close()}function findSlideNumber(uri){var i=uri.indexOf("#");if(i<0){return 0}var anchor=unescape(uri.substr(i+1));var target=document.getElementById(anchor);if(!target){var re=/\((\d)+\)/;if(anchor.match(re)){var num=parseInt(anchor.substring(1,anchor.length-1));if(num>slides.length){num=1}if(--num<0){num=0}return num}re=/\[(\d)+\]/;if(anchor.match(re)){var num=parseInt(anchor.sub

  • 1