
14 Jun
2012
14 Jun
'12
12:37 p.m.
I got it. For anyone else running into the problem from my earlier email, the way to get a null string is as follows: Replace this line: second <- text <<< atTag "second" -< x with this: second <- ((text `orElse` (constA "")) <<< atTag "second" -< x Fixed program: data Thing = Thing {first :: String, second :: String} getThings = atTag "thing" >>> proc x -> do first <- text <<< atTag "first" -< x second <- ((text `orElse` (constA "")) <<< atTag "second" -< x returnA -< Thing {first = first,second = second} atTag tag = deep (isElem >>> hasName tag) text = getChildren >>> getText parseThings str = runX (readString [withValidate no] str >>> getThings)
4723
Age (days ago)
4723
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ian Knopke