--b.hs
import System.Cmd
main = rawSystem "ls" ["-lh"]
$ runghc b.hs
b.hs:1:1: Warning:
Module ‘System.Cmd’ is deprecated: Use "System.Process" instead
import System.Process
main = createProcess (proc"ls" ["-lh"])
2018年11月2日金曜日
登録:
投稿 (Atom)
Haskell Process
Haskellの System.Processは便利ですが、問題もあります。 単一スレッドでの逐次処理を保証していない。(想像です。) 次のようなスクリプトを書いてみた。 --a.hs main = print [1..10] --t.hs import Sy...
-
ソースコードは下記アドレス https://github.com/index333/cellA 1次元のセル・オートマトンにルール30を適用して得た画像。 一部Repaを使ってみました。 以下のインストール が必要。 $ cab...
-
https://github.com/index333/spcal からソースがDLできます。 新バージョンは https://github.com/index333/spcal2 各寸法の測り方は https://www.sheldonbrown.com/...
-
2の平方根 $ runghc nroot.hs 2 2 | tee a 2の立方根 $ runghc nroot.hs 2 3 | tee b 猛列な勢いで計算しますので適当なファイルに保存もしています。(Ctrl-Cで停止) なお√2に...