fromList :: Apo.Coalg [(k, v)] (F.Tree k v)
fromList = Apo.Phi $ \f ->
  case f of
    []        -> F.Leaf
    (k, v):xs ->
      let l = take (length xs `div` 2) xs
          r = drop (length l) xs
      in F.Branch k v (Left l) (Left r)
fromList :: Apo.Coalg [(k, v)] (F.Tree k v)
fromList = Apo.Phi $ \f ->
  case f of
    []        -> F.Leaf
    (k, v):xs ->
      let l = take (length xs `div` 2) xs
          r = drop (length l) xs
      in F.Branch k v (Left l) (Left r)
fromList = Apo.Phi $ \f ->
  case f of
    []        -> F.Leaf
    (k, v):xs ->
      let l = take (length xs `div` 2) xs
          r = drop (length l) xs
      in F.Branch k v (Left l) (Left r)