---------------------------------------------------------------------
---Module      :   Properties  
--             a place to state some algebraic laws
--             used in tests 
-- compare with Data.Zero 
----------------------------------------------------------------------
-- {-# LANGUAGE FlexibleContexts #-}
-- {-# LANGUAGE MultiParamTypeClasses #-}
-- {-# LANGUAGE DefaultSignatures #-}
-- {-# LANGUAGE TypeOperators #-}

{-# OPTIONS -Wall #-}

module Uniform.Properties
  ( module Uniform.Properties
  )
where

import           Algebra.Laws             as Law
--import           Test.Framework
import           Test.Invariant           as Rule
prop_zero_mknull :: (Monoid a, Eq a)  => a -> Bool
prop_zero_mknull :: a -> Bool
prop_zero_mknull a
a = (a -> a -> a) -> a -> a -> Bool
forall a. Eq a => (a -> a -> a) -> a -> a -> Bool
Law.zero a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
a a
forall a. Monoid a => a
mempty

prop_assoz :: (Monoid a, Eq a)  => a -> a ->  a -> Bool
prop_assoz :: a -> a -> a -> Bool
prop_assoz a
a a
b a
c = (a -> a -> a) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> a) -> a -> a -> a -> Bool
Rule.associative a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
a a
b a
c

prop_concat :: (Monoid a, Eq a) => [a] -> Bool
prop_concat :: [a] -> Bool
prop_concat [a]
as =    [a] -> a
forall a. Monoid a => [a] -> a
mconcat [a]
as a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== (a -> a -> a) -> a -> [a] -> a
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr a -> a -> a
forall a. Monoid a => a -> a -> a
mappend a
forall a. Monoid a => a
mempty [a]
as



--prop_s2lat :: String -> Bool  -- will fail ? fails
--prop_s2lat = inverts lat2s s3lat

    --prop_s2latin :: String -> Bool     -- why does this always work?  (is the intermediate result ok?)
--prop_s2latin = inverts latin2s s2latin

--prop_s3latin :: String -> Bool     --inverts with reasonable intermediate value
--prop_s3latin s = inverts latin2s s2latin (convertLatin s)

--