Copyright | Guillaume Sabbagh 2022 |
---|---|
License | LGPL-3.0-or-later |
Maintainer | guillaumesabbagh@protonmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A container may be simplified internally by the call of a function simplify
. This is the case for WeakSet
s
and WeakMap
s 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 WeakSet
s
and WeakMap
s where duplicate elements remain in the container until the end of the lifetime of the container. Calling --simplify
on them will remove duplicate elements.
Nothing
A function to simplify a container recursively.