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

Language | Haskell2010 |

Adapted from https://hackage.haskell.org/package/digits

# Documentation

:: Integral n | |

=> n | The base to use (typically 10). |

-> n | The number to convert to digit form. |

-> [n] | Either Nothing or the digits of the number in list form. |

Returns the digits of a positive integer as a list. Throws an error if given a zero or negative base.