code-conjure-0.5.14: synthesize Haskell functions out of partial definitions
Copyright(c) 2019-2024 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Conjure.Conjurable.Derive

Description

Allows automatic derivation of Conjurable typeclass instances.

Synopsis

Documentation

deriveConjurable :: Name -> DecsQ Source #

Derives an Conjurable instance for the given type Name.

This function needs the TemplateHaskell extension.

If -:, ->:, ->>:, ->>>:, ... are not in scope, this will derive them as well.

For now, this function only derives conjureEquality, conjureTiers and conjureExpress and does not derive conjureSubTypes, conjureArgumentCases and conjureSize. These will be added in future versions. If you plan to use features that depend on these functionalities, please define your instances manually.

deriveConjurableCascading :: Name -> DecsQ Source #

Derives a Conjurable instance for a given type Name cascading derivation of type arguments as well.

For now, this function only derives conjureEquality, conjureTiers and conjureExpress and does not derive conjureSubTypes, conjureArgumentCases and conjureSize. These will be added in future versions. If you plan to use features that depend on these functionalities, please define your instances manually.

deriveConjurableIfNeeded :: Name -> DecsQ Source #

Same as deriveConjurable but does not warn when instance already exists (deriveConjurable is preferable).

For now, this function only derives conjureEquality, conjureTiers and conjureExpress and does not derive conjureSubTypes, conjureArgumentCases and conjureSize. These will be added in future versions. If you plan to use features that depend on these functionalities, please define your instances manually.