| Copyright | Guillaume Sabbagh 2022 |
|---|---|
| License | LGPL-3.0-or-later |
| Maintainer | guillaumesabbagh@protonmail.com |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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
- class Simplifiable a where
- simplify :: a -> a
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
A function to simplify a container recursively.