derive-2.5.13: A program and library to derive instances for data types

Safe Haskell | None

Data.Derive.From

Description

A pseudo derivation. For each constructor in the data type, deriving `From` generates `from` CtorName which extracts the components if given the appropriate constructor, and crashes otherwise. Unlike the DrIFT `"From"` derivation, our version works for all constructors - zero-arity constructors always return `()`, arity-one constructors return the contained value, and all others return a tuple with all the components.

# Documentation

makeFrom :: Derivation Source