feat: instances for Arbitrary
This commit is contained in:
parent
13a2577ae2
commit
8181113bfe
6 changed files with 83 additions and 16 deletions
|
@ -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 ]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue