Safe Haskell | Safe-Infered |
---|

- class Splittable s where
- boundedEnum :: forall s a. (Splittable s, Bounded a, Enum a) => s -> a
- data Left = L
- data Right = R

# Documentation

class Splittable s whereSource

Splittable datatypes are datatypes that can be used as seeds for unfolds.

split :: Int -> s -> [s]Source

`split n s`

splits the seed `s`

in `n`

seeds.

choose :: [s -> x] -> s -> xSource

`choose fs s`

uses part of the seed `s`

to choose a function from the list `fs`

,
and passes the remainder to that function.

Convert the seed value to an `int`

.

Splittable Integer | |

Splittable StdGen | |

Splittable Right | |

Splittable Left | |

Splittable s => Splittable (Dual s) | |

(Splittable a, Splittable b) => Splittable (Either a b) | |

(Splittable a, Splittable b) => Splittable (a, b) |

boundedEnum :: forall s a. (Splittable s, Bounded a, Enum a) => s -> aSource

If a datatype is bounded and enumerable, we can use `getInt`

to produce a value from a seed.