source code คือเนื้อหาหลัก ส่วน comment คือเนื้อหารอง
,comment จะแทรกอยู่ใน source code โดยมี prefix พิเศษนำหน้า
haskell มันมี file format อยู่อันหนึ่งที่เรียกว่า "lhs"
ถ้าอยู่ใน format นี้ source code จะหลายเป็นเนื้อหารองแทน
(คือต้องมี prefix นำหน้า)
-------------------------------------------------------------------------------
Haskell code and test cases
for the non-monadic stages
-------------------------------------------------------------------------------
This file contains the Haskell code for the various non-monadic stages
in the derivation of a Gaussian Elimination program using the
methodology. The remaining programs are in other files in the same
directory.
It also contains 3 sets of test data. Typing "main" runs the programs
for each non-monadic stage on this data and prints the results.
It needs modules which provide finite sequences:
> import SeqFinSeq
> import ParFinSeq
> import Cyclic
-------------------------------------------------------------------------------
The following function runs the functions on the test data:
> main :: IO()
> main = do putStr "The test data is:\n"
> putStr "1st set: \n"
> putStr ("a = " ++ (show a_matrix) ++ "\n")
> putStr ("b = " ++ (show b_vector) ++ "\n")
> putStr "2nd set: \n"
> putStr ("a = " ++ (show a2_matrix) ++ "\n")
> putStr ("b = " ++ (show b2_vector) ++ "\n")
> putStr "3rd set: \n"
> putStr ("a = " ++ (show a3_matrix) ++ "\n")
> putStr ("b = " ++ (show b3_vector) ++ "\n")
------------------------------
Test data (need a matrix A and a vector b)
> a_matrix :: Matrix Rational
> a_matrix = [[2,3],[1,-1]]
> b_vector :: Vector Rational
> b_vector = [25,10]