packages feed

Hs2lib-0.5.7: Tests/Exec/Structs.hs

{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Windll
-- Copyright   :  (c) Tamar Christina 2009 - 2010
-- License     :  BSD3
-- 
-- Maintainer  :  tamar@zhox.com
-- Stability   :  experimental
-- Portability :  portable
--
-- This module contains structural information on the module
--
-----------------------------------------------------------------------------

module Tests.Exec.Structs where

import WinDll.Structs.Structures

import Data.Data
import Data.Typeable

type Arbitraries = [Arbitrary]

-- | A Extended version of \Datatype\ to support weighing of 
--   constructors etc.
data Arbitrary = Arbitrary { arCosts :: (Int, Int)
                           , arName  :: Name
                           , arVars  :: [TypeName]
                           , arCons  :: Arbitraries
                           , arTag   :: TypeTag
                           }         
               | Variant   { arCost  :: Int
                           , arName  :: Name
                           , arFix   :: DataFixity
                           , arNamed :: AnnWeighedTypes
                           }
    deriving(Eq,Data,Typeable)
                           
type AnnWeighedTypes = [AnnWeighedType]

data AnnWeighedType = AnnWeighedType { awtCost :: Int
                                     , awtType :: AnnType
                                     }
    deriving(Eq,Data,Typeable)
    
deriving instance Show DataFixity
deriving instance Show Arbitrary
deriving instance Show AnnWeighedType