yoko-2.0: Generic Programming with Disbanded Data Types

Portabilitysee LANGUAGE pragmas (... GHC)
Stabilityexperimental
Maintainernicolas.frisby@gmail.com
Safe HaskellNone

Data.Yoko.SmartPreciseCase

Description

Using some McBride "Faking It" style trickery to make precise_case polyvariadic in the ad-hoc cases.

E.g.

 precise_case x (\(C_ a b) -> special_case a b) (Default $ \x -> generic_function x)

and

 precise_case x (\(C_ a b) -> special_case a b) (\(D_ x) -> special_case2 x) (Default $ \x -> generic_function x)

both work.

Documentation

precise_case0 :: Builder (Start dt) bldr => dt -> bldrSource

newtype Default a r Source

Constructors

Default (forall p1 p0. a p1 p0 -> r)