Haskell class is not like classes in Java or c++.
Haskell got many numeric types, which are Int, Integer and Float. You can compare two numbers of the same type for equality but in not different types. Also you can compare two values of type Bool for equality, but you cannot add them together. A class is a template for types, and it gives the operations that the types must do.
class Eq a where
(==), (/=) :: a -> a -> Bool
It defines the == and /= functions.
Simple type decleration
plus :: Int -> Int -> Int
plus x y = x + y
This plus function will get 2 Int numbers, do the calculation and then it will return an Int too.
This is a very useful concept in haskell.
Do an action from the type of which returns by the function.
Do an action which simply produce a value.
Do a chain "actions" together, while allowing the result of an action to be used for the second action
farther :: Person -> maybe Person
This function will return data with type Person or if there is no value it will return nothing.
let x = foo in bar can writtern as (\x -> bar) foo
x<-foo; bar can writtern as foo>>=(\x -> bar)
do putStr "Hello"
putStr " "
This will print in a sequence.
Then and do notations.
This is written by only using do naotation. but this can be wriiten by using bothe do and then notations like this;
msum :: MonadPlus m => [m a] -> m a
msum = foldr mplus mzero