Safe Haskell | None |
---|---|
Language | Haskell98 |
This module provides the ability to discharge a polymorphic variant using a record that has matching fields.
Documentation
class Switch (v :: Row *) (r :: Row *) x | v x -> r, r x -> v where Source #
switch :: Var v -> Rec r -> x Source #
Given a Variant and a Record of functions from each possible value of the variant to a single output type, apply the correct function to the value in the variant.
caseon :: Rec r -> Var v -> x Source #
The same as switch
but with the argument order reversed