Skip to content

Commit 8504290

Browse files
authored
Merge pull request #839 from IntersectMBO/pretty-instance-for-url
Add `Pretty` instance to `Url`
2 parents 1de8c17 + af2653d commit 8504290

File tree

1 file changed

+7
-0
lines changed
  • cardano-api/src/Cardano/Api/Internal

1 file changed

+7
-0
lines changed

cardano-api/src/Cardano/Api/Internal/Pretty.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{-# OPTIONS_GHC -Wno-orphans #-}
2+
13
module Cardano.Api.Internal.Pretty
24
( Ann
35
, Doc
@@ -24,6 +26,8 @@ where
2426

2527
import Cardano.Api.Internal.Via.ShowOf
2628

29+
import Cardano.Ledger.BaseTypes qualified as L
30+
2731
import Control.Exception.Safe
2832
import Data.Text qualified as Text
2933
import Data.Text.Lazy qualified as TextLazy
@@ -74,3 +78,6 @@ pshow = viaShow
7478
-- | Short hand for @'pretty' . 'displayException'@
7579
prettyException :: Exception a => a -> Doc ann
7680
prettyException = pretty . displayException
81+
82+
instance Pretty L.Url where
83+
pretty url = pretty (L.urlToText url)

0 commit comments

Comments
 (0)