WeakSets-1.6.1.0: Simple set types. Useful to create sets of arbitrary types and nested sets.
CopyrightGuillaume Sabbagh 2022
LicenseLGPL-3.0-or-later
Maintainerguillaumesabbagh@protonmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Simplifiable

Description

A container may be simplified internally by the call of a function simplify. This is the case for WeakSets and WeakMaps where duplicate elements remain in the container until the end of the lifetime of the container. Calling simplify on them will remove duplicate elements.

To derive automatically Simplifiable, add language extensions DeriveAnyClass and DeriveGeneric, import Generics and add Generic and Simplifiable to the derived typeclasses of your datatype. (For example : "data Foo a = Foo (Set a) deriving (Generic, Simplifiable)".)

Synopsis

Documentation

class Simplifiable a where Source #

A container may be simplified internally by the call of a function simplify. This is the case for WeakSets and WeakMaps where duplicate elements remain in the container until the end of the lifetime of the container. Calling --simplify on them will remove duplicate elements.

Minimal complete definition

Nothing

Methods

simplify :: a -> a Source #

A function to simplify a container recursively.

default simplify :: (Generic a, GSimplifiable (Rep a)) => a -> a Source #

Instances

Instances details
Simplifiable Int16 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Int16 -> Int16 Source #

Simplifiable Int32 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Int32 -> Int32 Source #

Simplifiable Int64 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Int64 -> Int64 Source #

Simplifiable Int8 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Int8 -> Int8 Source #

Simplifiable Word16 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Word16 -> Word16 Source #

Simplifiable Word32 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Word32 -> Word32 Source #

Simplifiable Word64 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Word64 -> Word64 Source #

Simplifiable Word8 Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Word8 -> Word8 Source #

Simplifiable Ordering Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Ordering -> Ordering Source #

Simplifiable Integer Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Integer -> Integer Source #

Simplifiable Natural Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Natural -> Natural Source #

Simplifiable () Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: () -> () Source #

Simplifiable Bool Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Bool -> Bool Source #

Simplifiable Char Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Char -> Char Source #

Simplifiable Double Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Double -> Double Source #

Simplifiable Float Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Float -> Float Source #

Simplifiable Int Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Int -> Int Source #

Simplifiable Word Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Word -> Word Source #

(Simplifiable a, Eq a) => Simplifiable (Set a) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Set a -> Set a Source #

Simplifiable a => Simplifiable (Maybe a) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Maybe a -> Maybe a Source #

Simplifiable a => Simplifiable [a] Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: [a] -> [a] Source #

(Simplifiable k, Simplifiable v, Eq k) => Simplifiable (Map k v) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Map k v -> Map k v Source #

(Simplifiable a, Simplifiable b) => Simplifiable (Either a b) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: Either a b -> Either a b Source #

(Simplifiable a, Simplifiable b) => Simplifiable (a, b) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: (a, b) -> (a, b) Source #

(Simplifiable a, Simplifiable b, Simplifiable c) => Simplifiable (a, b, c) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: (a, b, c) -> (a, b, c) Source #

(Simplifiable a, Simplifiable b, Simplifiable c, Simplifiable d) => Simplifiable (a, b, c, d) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: (a, b, c, d) -> (a, b, c, d) Source #

(Simplifiable a, Simplifiable b, Simplifiable c, Simplifiable d, Simplifiable e) => Simplifiable (a, b, c, d, e) Source # 
Instance details

Defined in Data.Simplifiable

Methods

simplify :: (a, b, c, d, e) -> (a, b, c, d, e) Source #