I have a list, with elements of some Node type, which may be either UNode or LNode or RNode
[
UNode("a"), LNode("b"), RNode("c")
]
How can I filter it by the type ( UNode for example)
List comprehensions seem useful here:
[ x | x@(Unode _) <- list ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With