GithubHelp home page GithubHelp logo

pos's Introduction

pos: a library for positive numbers

Hackage

Pos is designed to work with nonempty containers and also with configuration where zero is invalid.

Includes the following features:

  • a type Pos for representing positive numbers, excluding zero
  • presets for commonly used positive values such as _1P, _2P, _3P, ...
  • arithmetic operations
  • functions for safely converting to and from Pos

Where Pos is used:

  • The cybus package uses the Pos type with multidimensional arrays and indices where each dimension of the array is nonzero and the number of dimensions is nonzero.
  • Pos is also used in the primus package for dealing with nonempty containers.

Additional notes:

  • The Num instance is excluded to limit potential runtime errors arising from the use of fromIntegral, subtraction, or negation.
  • The Num1 class in the primus package offers a safer alternative to Num since it respects inherent bounds for those number types. Instances for Natural, Word, Pos, Int, etc. are defined.

pos's People

Contributors

gbwey avatar

Stargazers

 avatar

Watchers

 avatar

pos's Issues

Purpose of this library

Hi, I'm reading the documentation of this library and I have a hard time determining the purpose of the Pos datatype, compared to Word. Is there some advantage that I missed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.