I've heard how there are strategies in Haskell for tree implementation, but I haven't found any information about a good behavior tree alternative.
My goal: Given a tuple representing a state, what's the best pattern for feeding that tuble to a tree of behavior nodes that each return busy/error/completed/running based on the tuple. The behavior may also change the tuple (causing a state change).
Nested nodes can be executed based on the strategy of their parent node. For example, if a child node returns 'error', no more child nodes will be evaluated. Another strategy is to execute all child nodes even if an error state is returned.
I hope this makes sense!
Having found no BT implementations, I started some kind of implementation of BTs in Haskell myself, described here:
http://www.brainific.com/blog/2015/09/twisting-your-trees/
and stored here:
https://bitbucket.org/brainific/action-fw/src
With specific tests here:
https://bitbucket.org/brainific/action-fw/src/a6081b740dc4b8258f67f49df473458737fc4240/test/BehaviourTrees21Test.hs?at=master&fileviewer=file-view-default
Please note some different features from standard industry BTs:
Using Haskell has some issues (e.g., I still cannot bend the type system to express that a tree handling event type T1 can only contain subtrees that fire event type T1), but can provide some features with much expressive power (e.g. loops as infinite lazy lists).
Note that it is still fairly alpha or even pre-alpha! I am starting to integrate it with The Dark Mod (http://thedarkmod.com) where I hope to validate my assumptions. Feel free to send a mail if you end up interested.