Dear sir/madum

 

I am a Haskell beginner; I got the problem in use Haskell because I never touch it before. Can you help me to solve the following two exercises please?

 

 

Exercise 1

How to write a filter that removes all HTML tags from a HTML document, it should have the main function as following:

 

Main :: IO( )

Main = interact noTags

Where noTags :: String ->String is the function you will write to remove all text delimited by < and > from a String

 

 

Exercise 2

If there are three matrix

Matrix a =                 1      2      3

4      5      6

7      8      9

 

Matrix b =           1       -1       1

             -1        1     -1

                                1       -1      1

 

Matrix c =                 -1       1     -1

 1      -1      1

                                -1       1     -1

 

<+> Return the sum of two matrices

<->  Return the different of two matrices

<*> Return the product of two matrixes.

*> Return the product of a scalar and a matrix

Implement a module that can evaluate the expression             3.0 *> a <+> b <+> c

 

Would you please give some hint to me?

Thank you very much.

 

Your sincerely:

 

YAN ZHONG

 

 



与联机的朋友进行交流,请使用 MSN Messenger: 单击此处