Category Archives: Haskell

Haskell : Btree operations

data BT a = Leaf a |Node (BT a) (BT a) |Empty deriving (Show,Eq) — creating unbalanced tree from List mkTree (x:y:xs) = Node (Node (Leaf x ) (Leaf y ) ) (mkTree xs) mkTree [] = Empty mkTree [x] … Continue reading

Posted in Haskell | Tagged , | Leave a comment

Haskell version of currency conversion

Wrote one Java version on currency convertor https://ratndeo.wordpress.com/2012/10/23/java-submission-to-interfaces/ Here comes sophisticated Haskell version : data Operation = Add | Sub |Mul |Div deriving (Show,Eq) data Unit = Unit | Dollar | INR | EURO deriving (Show,Eq) data UnitPair = UnitPair … Continue reading

Posted in Haskell | Tagged , | Leave a comment