[number] add simple combinator
This commit is contained in:
parent
427541064d
commit
5c0daae88c
@ -11,6 +11,7 @@
|
|||||||
{-# LANGUAGE UnboxedTuples #-}
|
{-# LANGUAGE UnboxedTuples #-}
|
||||||
module Crypto.Number.Compat
|
module Crypto.Number.Compat
|
||||||
( GmpSupported(..)
|
( GmpSupported(..)
|
||||||
|
, onGmpUnsupported
|
||||||
, gmpGcde
|
, gmpGcde
|
||||||
, gmpLog2
|
, gmpLog2
|
||||||
, gmpPowModSecInteger
|
, gmpPowModSecInteger
|
||||||
@ -39,6 +40,10 @@ data GmpSupported a = GmpSupported a
|
|||||||
| GmpUnsupported
|
| GmpUnsupported
|
||||||
deriving (Show,Eq)
|
deriving (Show,Eq)
|
||||||
|
|
||||||
|
onGmpUnsupported :: GmpSupported a -> a -> a
|
||||||
|
onGmpUnsupported (GmpSupported a) _ = a
|
||||||
|
onGmpUnsupported GmpUnsupported f = f
|
||||||
|
|
||||||
gmpGcde :: Integer -> Integer -> GmpSupported (Integer, Integer, Integer)
|
gmpGcde :: Integer -> Integer -> GmpSupported (Integer, Integer, Integer)
|
||||||
#if MIN_VERSION_integer_gmp(0,5,1)
|
#if MIN_VERSION_integer_gmp(0,5,1)
|
||||||
gmpGcde a b =
|
gmpGcde a b =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user