Display example node

This commit is contained in:
Joscha 2020-02-08 23:33:25 +00:00
parent ff2dc3e783
commit 8fb3ab19c8
2 changed files with 14 additions and 4 deletions

View file

@ -18,6 +18,8 @@ module Forest.Node
, isValidPath
, narrowPath
, narrowSet
-- * Example values
, exampleNode
) where
import Control.Monad
@ -86,3 +88,11 @@ narrowPath _ _ = Nothing
narrowSet :: NodeId -> Set.Set Path -> Set.Set Path
narrowSet x s = Set.fromList [Path ys | Path (y:ys) <- Set.toList s, x == y]
{- For testing -}
exampleNode :: Node
exampleNode = Node "Tool box" False False True False $ Map.fromList
[ ("hammer", Node "Hammer" False True False True Map.empty)
, ("nail", Node "Nail" False True False False Map.empty)
]