Flint2: Haskell bindings for the flint library for number theory

[ gpl, library, math ] [ Propose Tags ]
This version is deprecated.

Please see the README on GitHub at https://github.com/monien/Flint2#readme


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5 (info)
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), groups, QuickCheck [details]
License BSD-3-Clause
Copyright Copyright (c) 2022 Hartmut Monien
Author Hartmut Monien
Maintainer hmonien@uni-bonn.de
Category Math
Home page https://github.com/monien/Flint2#readme
Bug tracker https://github.com/monien/Flint2/issues
Source repo head: git clone https://github.com/monien/Flint2
Uploaded by monien at 2023-10-13T19:13:28Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 67 total (10 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for Flint2-0.1.0.1

[back to package description]

Flint2

Flint2 provides a thin Haskell wrapper for Flint C-library.

Installation

  • Install the C-library available from Flint. There are packages available for various operating systems.

  • Install the Haskell interface with

cabal install Flint2

Quick Start

A simple program using the thin wrapper would be

import Data.Number.Flint

main = do 
  x <- newFmpz
  y <- newFmpz
  withFmpz x $ \x -> do
    withFmpz y $ \y -> do
      fmpz_set_ui x 7
      fmpz_set_ui y 6
      fmpz_mul x x y
      fmpz_print x  

which will print the numerical value 42.

In the app directory more practical information on how to use the thin wrapper can be found. The above example simplifies to

include Fmpz

main = do
  let x = 7 :: Fmpz 
      y = 6 :: Fmpz
  print $ x*y
  print $ factor (42 :: Fmpz)
  

which prints

42 
[(2,1),(3,1),(7,1)]