This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dict> | |
<key>begin</key> | |
<!-- By default, maximum number of spaces before the bullet | |
character is 3. To support multiple nested lists, I changed | |
it to infinite. --> | |
<string>^[ ]*([*+-])(?=\s)</string> | |
<key>captures</key> | |
<dict> | |
<key>1</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
EXTNull | |
Experimental | |
EXTNull is a subclass of NSNull that acts more like nil. | |
Calling unrecognized methods on EXTNull *will not* throw | |
a NSInvalidArgumentException but again return EXTNull. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- parseExpr :: something -> Either ParseError Expression | |
convert :: String -> Either String String | |
convert input = case parseExpr input of | |
Left err -> Left $ show err | |
Right x -> Right $ show x | |
-- Want: | |
convert = magicfunction show $ parseExpr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Tree a = Leaf a | Node a [Tree a] | |
scanDir :: String -> IO (Tree String) | |
scanDir path = do | |
contents <- getDirectoryContents path `catch` const (return []) | |
let files = sort . filter (`notElem` [".", ".."]) $ contents | |
let pathsAndFiles = zip (repeat path) files | |
tree <- forM pathsAndFiles $ \(path, file) -> do | |
isDirectory <- doesDirectoryExist path | |
if isDirectory |
NewerOlder