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.
-
generic-records
Generically derive traversals, lenses, and prisms. -
generic-deriving
Generic programming library for generalised deriving. -
uniplate
Haskell library for simple, concise and fast generic operations. -
records-sop
Experimental implementation of generic record subtyping -
generics-eot
A library for generic programming that aims to be easy to understand -
generic-override-aeson
Override instances used by Haskell's generic derivation -
Capabilities
A Haskell library providing separation of effects on the type level, effectively splitting up the monolithic IO-monad into more limited capabilities. -
GenericPretty
A generic, derivable, haskell pretty printer - Research project, summer of 2011 -
generic-lens-labels
GHC.OverloadedLabels.IsLabel instance for lenses from ghc-generics -
compdata-param
Haskell library implementing parametric compositional data types. -
instant-generics
Code repository for the instant-generics library -
Strafunski-StrategyLib
Cabalized version of the StrategyLib library from Strafunski -
text-generic-pretty
A generic, derivable, haskell pretty printer - Research project, summer of 2011 -
xformat
Extensible, typed, scanf- and printf-like functions for formatted reading and showing in Haskell -
Annotations
Constructing, analyzing and destructing annotated trees -
projection
Projection function for arbitrarily nested binary product types. -
deriving-show-simple
Derive a Show instance without field selector names -
church
Automatically convert Generic instances to and from church representations -
compdata-fixplate
Compdata basics implemented on top of Fixplate -
generic-optics-lite
Monomorphic field opics like with generic-lens
Updating dependencies is time-consuming.
Do you think we are missing an alternative of pretty-sop or a related project?
README
pretty-sop
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 }