{-# LANGUAGE ScopedTypeVariables, EmptyDataDecls #-}
import Data.Function
data Zero
data Succ a
class Nat a where
instance Nat Zero where
instance (Nat a) => Nat (Succ a) where
type One = Succ Zero
type Two = Succ One
type Three = Succ Two
type Four = Succ Three
type Five = Succ Four
instance (Nat
mod) => Num (ModNInt
mod) where (+) = convop2 (+)
(-) = convop2 (-)
(*) = convop2 (*)
main
= print [a
-b
, a
*b
, a
+b
-c
]
ey0jIExBTkdVQUdFICBTY29wZWRUeXBlVmFyaWFibGVzLCBFbXB0eURhdGFEZWNscyAjLX0KaW1wb3J0IERhdGEuRnVuY3Rpb24KZGF0YSBaZXJvIApkYXRhIFN1Y2MgYSAKCmNsYXNzIE5hdCBhIHdoZXJlCiB0b0ludDo6YS0+SW50CgppbnN0YW5jZSBOYXQgWmVybyB3aGVyZQogdG9JbnQgPSBjb25zdCAwCgppbnN0YW5jZSAoTmF0IGEpID0+IE5hdCAoU3VjYyBhKSB3aGVyZQogdG9JbnQgPSBjb25zdCAkIHRvSW50ICh1bmRlZmluZWQ6OmEpICsgMQoKCnR5cGUgT25lID0gU3VjYyBaZXJvCnR5cGUgVHdvID0gU3VjYyBPbmUKdHlwZSBUaHJlZSA9IFN1Y2MgVHdvCnR5cGUgRm91ciA9IFN1Y2MgVGhyZWUKdHlwZSBGaXZlID0gU3VjYyBGb3VyCgpkYXRhIE1vZE5JbnQgbW9kID0gTU4ge2ludDo6SW50fSBkZXJpdmluZyAoIEVxLCBPcmQpCgppbnN0YW5jZSBTaG93IChNb2ROSW50IG1vZCkgd2hlcmUKICBzaG93ID0gc2hvdyAuIGludAoKaW5zdGFuY2UgKE5hdCBtb2QpID0+IEVudW0gKE1vZE5JbnQgbW9kKSB3aGVyZQogIHRvRW51bSA9IE1OIC4gKGBtb2RgIHRvSW50ICh1bmRlZmluZWQ6Om1vZCkpCiAgZnJvbUVudW0gPSBpbnQKCmNvbnZvcDIgcCB4IHkgPSB0b0VudW0gJCAocCBgb25gIGZyb21FbnVtKSB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