feat: instances for Arbitrary

This commit is contained in:
vegowotenks 2025-08-14 09:21:34 +02:00
parent 13a2577ae2
commit 8181113bfe
6 changed files with 83 additions and 16 deletions

View file

@ -1,12 +1,20 @@
{-# LANGUAGE Safe #-}
{-# LANGUAGE InstanceSigs #-} -- function signature in instances
module Language.Scalie.Domain.Type (Type(..)) where
import Data.Kind qualified
import Text.Show (Show)
import Text.Read (Read)
import Data.Eq (Eq)
import Test.QuickCheck (Arbitrary (arbitrary), Gen, oneof)
import Control.Applicative (Applicative(pure))
type Type :: Data.Kind.Type
data Type
= RawInt
deriving stock (Show, Read)
deriving stock (Show, Read, Eq)
instance Arbitrary Type where
arbitrary :: Gen Type
arbitrary = oneof [ pure RawInt ]