Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Haskell: Comments

Comments are used to document your code neatly. Haskell provides two types of comments.

Single line comments
Single line comments starts with -- and continues till the end of line.

Multi line comments
You can write multi line comments in between {- … -}.


interest.hs
p = 100000 -- Principal 
t = 1.10 -- Time in years
r = 5 -- Rate of interest per annum (p.a.)

{- Let Principal = P, Rate = R% per annum (p.a.) and Time = T years. Then,
Simple Interest = (P x R x T)/100
-}
interest = p * t * r *0.01

*Main> :load interest.hs
[1 of 1] Compiling Main ( interest.hs, interpreted )
Ok, modules loaded: Main.
*Main>
*Main> interest
5500.000000000001



Previous                                                 Next                                                 Home


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Haskell: Comments

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×