mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
8ea325348a
commit
9ea1cd195c
|
@ -40,8 +40,7 @@ glob pat ignore dir action = runContT (callCC $ \exit -> go exit dir) pure
|
||||||
unless continue (exit ())
|
unless continue (exit ())
|
||||||
else do
|
else do
|
||||||
isD <- liftIO $ doesDirectoryExist fn
|
isD <- liftIO $ doesDirectoryExist fn
|
||||||
if not isD then exit ()
|
when isD do
|
||||||
else do
|
|
||||||
content <- liftIO (try @_ @IOError $ listDirectory fn)
|
content <- liftIO (try @_ @IOError $ listDirectory fn)
|
||||||
<&> fromRight mempty
|
<&> fromRight mempty
|
||||||
-- TODO: memory-hungry
|
-- TODO: memory-hungry
|
||||||
|
|
|
@ -867,6 +867,11 @@ internalEntries = do
|
||||||
pure $ if a == b then mkBool True else mkBool False
|
pure $ if a == b then mkBool True else mkBool False
|
||||||
_ -> throwIO (BadFormException @c nil)
|
_ -> throwIO (BadFormException @c nil)
|
||||||
|
|
||||||
|
entry $ bindMatch "length" $ \case
|
||||||
|
[ListVal es] -> pure $ mkInt (length es)
|
||||||
|
[StringLike es] -> pure $ mkInt (length es)
|
||||||
|
_ -> pure $ mkInt 0
|
||||||
|
|
||||||
entry $ bindMatch "nil?" $ \case
|
entry $ bindMatch "nil?" $ \case
|
||||||
[ListVal []] -> pure $ mkBool True
|
[ListVal []] -> pure $ mkBool True
|
||||||
_ -> pure $ mkBool False
|
_ -> pure $ mkBool False
|
||||||
|
|
Loading…
Reference in New Issue