There are a lot of domain specific tools that are used for specific tasks where the main software is taking care of architecture, high level decisions and resources. Shaders are one example of this. Trying to write non trivial software like this is problematic because the structure you are using is so disconnected from what the software needs to do.
I'm assuming you are referring to Haskell? It's a general purpose programming language so of course it handles state, branching, etc...
data Tree a = Empty | Leaf a | Node a [Tree a]
deriving stock (Show, Functor, Foldable, Traversable)
label :: Tree a -> Tree (a, Int)
label t = evalState (traverse f t) 0 where
f t' = state (\c -> ((t', c), c + 1))
The above code labels nodes of a multiway tree using a counter. State and branching.This looks like it is lazily evaluating parts of a tree, which means that you aren't controlling that state, you are hoping that everything works out when you query it with regards to resources, caching, memory layout, memory freeing, etc.
In a non-trivial program that either will need to optimize memory and cpu usage to scale or be careful about how things are structured to maintain interactivity, something like this is likely to be a big problem if that tree gets big.