annotate Main.hs @ 3:090bdde20e9f

add Main.hs
author Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
date Tue, 26 Mar 2013 18:28:54 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 module Main where
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 import Jungle
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 import qualified Data.ByteString.Char8 as C
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 x = createTree createJungle "new_tree"
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 tree = getTreeByName x "new_tree"
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 new_tree = addNewChildAt tree [] 0 Empty
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 new_tree2 = putAttribute tree [] "key" (C.pack "value")
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 main = do print $ createJungle
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 print x
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 print $ getTreeByName x "new_tree"
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 print new_tree
090bdde20e9f add Main.hs
Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 print new_tree2