Thursday, December 17, 2009

Installing gtk2hs on Snow Leopard

Installed gtk2hs today on Snow leopard. It took a lot of work. Here's my summary:

Follow the Instructions on the HaskellWiki (download gtk2hs, install the GTK+ framework, install pkgconfig)

Add the following variable to you environment.plist file:


In the gtk2hs directory run:

./configure --disable-split-objs --disable-gio
sudo make install

Useful Sites
Haskell Cafe from Mail

Friday, December 11, 2009

My First Haskell word in line finder

I stuck at it, and here is my finished haskell program to find all lines that contain a certain word:
findStrb :: String -> String -> Bool
findStrb key str = if key `isInfixOf` str then True else False
printList :: [String] -> IO ()
printList (x:xs) = do
putStrLn x
printList xs
main :: IO ()
main = do
infile <- readFile "ec2_list"
printList [x | x <- lines infile, findStrb "kernel" x]