Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let addChild updateNode addNode value parent =
- match withNewChild value parent with
- | None -> async.Return None
- | Some (newParent, child) as path ->
- async { do! addNode child
- do! updateNode newParent
- return Some child }
- let addChildById getNode updateNode addNode logAction value parentId =
- async { let! parent = getNode parentId
- let! childOpt = addChild updateNode addNode value parent
- match childOpt with
- | None -> return None
- | Some child ->
- let action = AddNode { value = value; nodeId = nodeId; leafId = child.id }
- do! logAction action
- return Some child.id }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement