Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove finite-field dependency #2673

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ dependencies:
- file-embed == 0.0.*
- filelock == 0.1.*
- filepath == 1.4.*
- finite-field == 0.10.*
- ghc == 9.8.1
- githash == 0.1.*
- hashable == 1.4.*
Expand Down
18 changes: 18 additions & 0 deletions src/Juvix/Data/FiniteField/Base.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Juvix.Data.FiniteField.Base where

import Juvix.Prelude.Base

class (Fractional k) => FiniteField k where
-- | The order is number of elements of a finite field @k@.
-- It of the form @p^n@, where @p@ is prime number called the characteristic
-- of the field, and @n@ is a positive integer.
order :: k -> Integer

-- | The characteristic of a field, @p@.
char :: k -> Integer

-- | The inverse of Frobenius endomorphism @x@ ↦ @x^p@.
pthRoot :: k -> k

-- | All values of a field
allValues :: [k]
2 changes: 1 addition & 1 deletion src/Juvix/Data/FiniteField/PrimeField.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ module Juvix.Data.FiniteField.PrimeField
)
where

import Data.FiniteField.Base
import Data.Hashable
import Data.Ratio (denominator, numerator)
import Data.Singletons
import GHC.TypeLits
import GHC.TypeLits.Singletons ()
import Juvix.Data.FiniteField.Base
import Language.Haskell.TH qualified as TH
import Prelude hiding (toInteger)

Expand Down
1 change: 0 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ resolver: nightly-2024-02-06
extra-deps:
- git: https://github.com/Vekhir/aeson-better-errors.git
commit: 1ec49ab7d1472046b680b5a64ae2930515b47714
- finite-field-0.10.0@sha256:f676a7abf829f27fee189036219c0326dce68a435bcdddc26319afff4008d8f4,2164
allow-newer: true
allow-newer-deps:
- aeson-better-errors
Loading