Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

# Documentation

class Case c (xs :: [Type]) where Source #

This class allows defining handlers that can handle the `Head`

type in the `xs`

typelist.
In conjunction with `Reiterate`

, you can define handlers that can handle all
the types in the `xs`

typelist.

See Data.Diverse.CaseFunc and Data.Diverse.Cases.

case' :: c xs -> Head xs -> CaseResult c (Head xs) Source #

Return the handler/continuation when x is observed.

## Instances

k x => Case (CaseFunc' k) (x ': xs) Source # | |

Defined in Data.Diverse.CaseFunc | |

UniqueMember (Head xs -> r) fs => Case (Cases fs r) xs Source # | UndecidableInstances because |

Defined in Data.Diverse.Cases | |

k x => Case (CaseFunc k r) (x ': xs) Source # | |

Defined in Data.Diverse.CaseFunc | |

MemberAt n (Head xs -> r) fs => Case (CasesN fs r n) xs Source # | UndecidableInstances because |

Defined in Data.Diverse.Cases | |

(k (f x), k1 f, k0 x) => Case (CaseFunc1' k k1 k0) (f x ': xs) Source # | |

Defined in Data.Diverse.CaseFunc case' :: CaseFunc1' k k1 k0 (f x ': xs) -> Head (f x ': xs) -> CaseResult (CaseFunc1' k k1 k0) (Head (f x ': xs)) Source # | |

(k (f x), k1 f, k0 x) => Case (CaseFunc1 k k1 k0 r) (f x ': xs) Source # | |

Defined in Data.Diverse.CaseFunc |