2022-02-09 00:26:58 +00:00
|
|
|
module FFI.Data.Scientific where
|
|
|
|
|
2022-02-18 19:09:00 +00:00
|
|
|
open import Agda.Builtin.Float using (Float)
|
|
|
|
open import FFI.Data.String using (String)
|
|
|
|
open import FFI.Data.HaskellString using (HaskellString; pack; unpack)
|
|
|
|
|
2022-02-09 00:26:58 +00:00
|
|
|
{-# FOREIGN GHC import qualified Data.Scientific #-}
|
2022-02-18 19:09:00 +00:00
|
|
|
{-# FOREIGN GHC import qualified Text.Show #-}
|
2022-02-09 00:26:58 +00:00
|
|
|
|
|
|
|
postulate Scientific : Set
|
|
|
|
{-# COMPILE GHC Scientific = type Data.Scientific.Scientific #-}
|
2022-02-18 19:09:00 +00:00
|
|
|
|
|
|
|
postulate
|
|
|
|
showHaskell : Scientific → HaskellString
|
|
|
|
toFloat : Scientific → Float
|
|
|
|
|
|
|
|
{-# COMPILE GHC showHaskell = \x -> Text.Show.show x #-}
|
|
|
|
{-# COMPILE GHC toFloat = \x -> Data.Scientific.toRealFloat x #-}
|
|
|
|
|
|
|
|
show : Scientific → String
|
|
|
|
show x = pack (showHaskell x)
|