All pastes #635908 Raw Edit

Stuff

public text v1 · immutable
#635908 ·published 2007-07-27 13:49 UTC
rendered paste body
module Hasplot where

import Text.Printf

funcArgs start end points = 
        let step = (end - start) / ( points - 2)::Float
        in
          [start, (start + step) .. end]

funcTable f [] = []
funcTable f (x:xs) = (x, f x) : funcTable f xs

pair2str (x,y) = printf "%.05f %.05f" x y
func2table x = unlines ( map pair2str x)

main fileName func args = do
    writeFile fileName (func2table $ funcTable func args)