O5WOFYXPZAH6Y7HUQ5E47LQAZFISCNODY5LFHUONA2Q6ZRLPTOHAC
BRJMDWYDEP5P765MXKA7UOM5YE6OSPUHQRY67AX6WJNGACQFRLHAC
H5ZMKSRCKHPZZTZ6ITFKMDWSF25AIJZBEKX6SD77NBHW7ZFX3DSQC
4XWXRK36AQKTBU4DUEH4UEHDAJQYDQXBCGD3G2TZDIKYNMNPZ3CQC
5FL4GFXIQJ3P7U5DD7VUEZHNZTTN7DERSUBQ64JZEPLU4PRX4K5QC
ZJ6BESB2ZX5KZWQRANKZFHPP64H3WQHF56PMFFMZIKVSIZSX3SXAC
F3PSUKWXAFKSWPWD4OFGDMMOPGRZVLJWWHNWOHRDP677PZVFTRIQC
instance (KnownNat x, KnownNat y, KnownNat z) => Pretty (Budget c '(x, y, z)) where
pretty budget = "Budget" <+> rule budget
instance (KnownSymbol c, KnownNat x, KnownNat y, KnownNat z) => Pretty (Budget c '(x, y, z)) where
pretty budget = concatWith (surround hardline) [header, need, want, saving]
where
header = "Budget" <+> pretty (toRule budget)
need = pretty Needs <+> pretty (Budget.needs budget)
want = pretty Wants <+> pretty (Budget.wants budget)
saving = pretty Savings <+> pretty (Budget.savings budget)
fromBudget :: forall curr a b c. (KnownSymbol curr, KnownNat a, KnownNat b, KnownNat c) => Budget curr '(a, b, c) -> Doc ()
fromBudget budget = header <> hardline <> need <> hardline <> want <> hardline <> saving
where
header = pretty budget
need = pretty Needs <+> pretty (Budget.needs budget)
want = pretty Wants <+> pretty (Budget.wants budget)
saving = pretty Savings <+> pretty (Budget.savings budget)
rule :: forall a b c proxy (curr :: Symbol) ann. (KnownNat a, KnownNat b, KnownNat c) => proxy curr '(a, b, c) -> Doc ann
rule _ = concatWith (surround "/") . map pretty $ [natVal (Proxy @a), natVal (Proxy @b), natVal (Proxy @c)]