{- | This module contains parametrized membership function for fuzzy relations
    use currying to construct the functions 
    arguments a b c ... are parameters for constructing specific functions 
    (x, y) is pair for which membership is evaluated
-}
module Fuzzy.Relations.MembershipFunctions (
    isCloseTo
) where

import Lattices.ResiduatedLattice

-- | fuzzy relation representing closeness of two numbers

isCloseTo :: ResiduatedLattice l => (Double, Double) -> l
isCloseTo :: forall l. ResiduatedLattice l => (Double, Double) -> l
isCloseTo (Double
x, Double
y) = forall l. BoundedLattice l => Double -> l
mkLattice forall a b. (a -> b) -> a -> b
$ forall a. Ord a => a -> a -> a
max Double
0 (Double
1 forall a. Num a => a -> a -> a
- forall a. Num a => a -> a
abs (Double
x forall a. Num a => a -> a -> a
- Double
y))