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