From b57b1b1afa7f359af5223e74a1e0c8a2b21c8b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Sun, 2 May 2021 11:40:32 +0200 Subject: string interpolation for show --- ecc.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ecc.hs b/ecc.hs index 7c485d0..a35fb24 100644 --- a/ecc.hs +++ b/ecc.hs @@ -1,3 +1,4 @@ +import Text.Printf data FieldElement = FieldElement @@ -56,9 +57,7 @@ data ECPoint instance Show ECPoint where show Infinity = "ECPoint(Infinity)" - show p = - "ECPoint(" ++ - show (x p) ++ ", " ++ show (y p) ++ ")_" ++ show (a p) ++ "_" ++ show (b p) + show p = printf "ECPoint(%f, %f)_%f_%f" (x p) (y p) (a p) (b p) validECPoint :: ECPoint -> Bool validECPoint Infinity = True -- cgit v1.2.3