Popularity
7.2
Stable
Activity
0.0
Stable
12
10
2

Monthly Downloads: 24
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Generics    
Latest version: v0.2.0.3

pretty-sop alternatives and similar packages

Based on the "Generics" category.
Alternatively, view pretty-sop alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of pretty-sop or a related project?

Add another 'Generics' Package

README

pretty-sop

Build Status Hackage

This library contains a generic implementation of the prettyVal function from the pretty-show package. Using the pretty printer, values can easily be rendered to strings and HTML documents in a uniform way.

This library makes use of the generics-sop package and is an example of a generic function defined in the SOP style.

This is the development repository. For releases, look on Hackage.

Example

{-# LANGUAGE DeriveGeneric #-}

import Generics.SOP.PrettyVal
import Generics.SOP
import qualified GHC.Generics as G
import Text.Show.Pretty


data Car = Car
  { name :: String
  , seats :: Int
  } deriving (G.Generic)

instance Generic Car
instance HasDatatypeInfo Car
instance PrettyVal Car where
  prettyVal = gprettyVal

main :: IO ()
main = putStrLn $ dumpStr $ Car "test" 3

would print:

Car { name = test , seats = 3 }