1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use super::*;

impl Debug for DayanPsi {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            DayanPsi::Number(v) => {
                f.write_fmt(format_args!("{}", v))
            }
            DayanPsi::Omega => {
                f.write_str("ϕ(0)")
            }
            DayanPsi::Psi(v) => {
                f.write_str("ϕ(")?;
                for (index, node) in v.iter().enumerate() {
                    if index != 0 {
                        f.write_str(", ")?;
                    }
                    Debug::fmt(node, f)?;
                }
                f.write_char(')')
            }
        }
    }
}


impl Display for DayanPsi {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            DayanPsi::Omega => {
                f.write_char('ω')
            }
            _ => Debug::fmt(self, f),
        }
    }
}