Work on converting inventory list to tree

This commit is contained in:
2024-09-10 14:31:36 +01:00
parent 52d0008441
commit 854fc96ac7
5 changed files with 114 additions and 24 deletions
+3
View File
@@ -13,5 +13,8 @@ import Data.Aeson.TH
data DoubleTree a = DT {_dtValue :: a,_dtLeft :: [DoubleTree a],_dtRight :: [DoubleTree a]}
deriving (Eq,Ord,Show,Read)
instance Functor DoubleTree where
fmap f (DT x l r) = DT (f x) (fmap (fmap f) l) (fmap (fmap f) r)
makeLenses ''DoubleTree
deriveJSON defaultOptions ''DoubleTree