packages feed

acme-schoenfinkel-0.1.0: 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_schoen :: Fun (Int, Int) Int -> Int -> Int -> Bool
prop_schoen (Fun _ f) x y = schoen 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)


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