What will we do until Xmas? Of course we will prepare for it!
Let's print Xmas tree by your favourite language!
All winners will get a present ;) More under the cut
about a month ago I had to parse some data and serialize it back filtering wrong entries
data looks like csv 123;asd;... etc, with known field types, but it can be broken
I asked my teammates for help and got this solutions show me
They are quite nice, you can just use them.
toH n = hs !! (n-1)
where hs = [H.h1, H.h2, H.h3, H.h4, H.h5] ++ cycle [H.h6]
Actually you don't have many choices, template haskell is kind of overkill for such simple case.
#haskell #lazyeval
parseF cls = WrapArrow $ listA (deep (hasCls cls) //> getText) >>> arr concat
parseHole =
unwrapArrow $ Hole <$> parseF "date"
<*> parseF "service"
<*> parseF "status_text"
<*> parseF "status_days"
#haskell #Control_Applicative #arrows
I got strange behavior of code, which simplified version looks like this
readFile "testf" >> writeFile "testf" "tests"
the error was:
fio: testf: openFile: resource busy (file is locked) moar I want MOOOAAARRR!