ntityToNode ∷ Maybe Entity → IO (Maybe Node)
entityToNode maybeEntity = do
  ctx ← getFuseContext
  case maybeEntity of
    Just (FileEntity _ (File _ contents)) →
      return $ Just $ FileNode (contentsFileStat ctx contents) contents
    Just (TagEntity _ (Tag _)) →
      return $ Just $ DirNode (dirStat ctx)
    Nothing →
      return Nothing

entityToNode ∷ Maybe Entity → IO (Maybe Node)
entityToNode maybeEntity = do
  ctx ← getFuseContext
  case maybeEntity of
    Just (FileEntity _ (File _ contents)) →
      return $ Just $ FileNode (contentsFileStat ctx contents) contents
    Just (TagEntity _ (Tag _)) →
      return $ Just $ DirNode (dirStat ctx)
    Nothing →
      return Nothing
entityToNode maybeEntity = do
  ctx ← getFuseContext
  case maybeEntity of
    Just (FileEntity _ (File _ contents)) →
      return $ Just $ FileNode (contentsFileStat ctx contents) contents
    Just (TagEntity _ (Tag _)) →
      return $ Just $ DirNode (dirStat ctx)
    Nothing →
      return Nothing