{-# LANGUAGE DataKinds #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeApplications #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Main (main) where import Data.Mod (Mod) import GHC.TypeNats (KnownNat) import Numeric.Natural (Natural) import Test.QuickCheck (Arbitrary, arbitrary) import Test.QuickCheck.Instances () newtype Fq = Fq (Mod 18446744073709551616 {- 2^64 -}) deriving (Num) instance KnownNat n => Arbitrary (Mod n) where arbitrary = fromIntegral <$> arbitrary @Natural instance Arbitrary Fq where arbitrary = Fq <$> arbitrary main :: IO () main = let Fq x = -1 in print x