Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main where
- import System.Environment
- import Interpolation
- import PointReader
- import OutputWriter
- import Point
- mainCycle :: InterpolationType -> Double -> [Point] -> IO ()
- mainCycle typ freq p = do
- new_p <- readPoint
- if (isEnd new_p) then
- if (null p) then
- putStrLn "Points wasn't inputed!!!"
- else
- if (isThreaded typ) then do
- putStrLn "Interpolation done!!!"
- showPoint (head p)
- else do
- showInterpolation freq True (createInterpolation typ p)
- putStrLn "Interpolation done!!!"
- else if (isError new_p) then
- do
- putStrLn "Input format schould be: <Double>; <Double>"
- mainCycle typ freq p
- else
- if ((isThreaded typ) && (not (null p))) then
- do
- showInterpolation freq False (createInterpolation typ ([head $ p] ++ [getPoint new_p]))
- mainCycle typ freq ((getPoint new_p) : [])
- else
- mainCycle typ freq (p ++ [getPoint new_p])
- main :: IO ()
- main = do
- x <- getArgs
- let interpolationType = typeFromString $ x !! 0
- let frequency = read $ x !! 1 :: Double
- putStrLn . show $ interpolationType
- putStrLn . show $ frequency
- mainCycle interpolationType frequency []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement