packages feed

acme-schoenfinkel-0.1.1: test/Props.hs

-- |
-- Module:     Main
-- Copyright:  (c) 2013 Ertugrul Soeylemez
-- License:    BSD3
-- Maintainer: Ertugrul Soeylemez <es@ertes.de>

module Main where

import Control.Category.Schoenfinkel
import Test.Framework.Providers.QuickCheck2
import Test.Framework.TH
import Test.QuickCheck.Function


prop_hässlich :: Fun Int (Fun Int Int) -> Int -> Int -> Bool
prop_hässlich (Fun _ f') x y =
    let f = apply . f'
    in hässlich f (x, y) == uncurry f (x, y)


prop_schoen :: Fun (Int, Int) Int -> Int -> Int -> Bool
prop_schoen (Fun _ f) x y = schoen f x y == curry f x y


prop_schön :: Fun (Int, Int) Int -> Int -> Int -> Bool
prop_schön (Fun _ f) x y = schön f x y == curry f x y


prop_unschoen :: Fun Int (Fun Int Int) -> Int -> Int -> Bool
prop_unschoen (Fun _ f') x y =
    let f = apply . f'
    in unschoen f (x, y) == uncurry f (x, y)


prop_unschön :: Fun Int (Fun Int Int) -> Int -> Int -> Bool
prop_unschön (Fun _ f') x y =
    let f = apply . f'
    in unschön f (x, y) == uncurry f (x, y)


main :: IO ()
main = $(defaultMainGenerator)