Skip to content

tanakh/blaze-show

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blaze-show

An Alternative of Show class using blaze-builder with Generic Deriving

Examples

BlazeShow class can derive automatically.

{-# LANGUAGE DeriveGeneric #-}

import qualified Data.ByteString.Char8 as S
import           GHC.Generics
import           Blaze.Show

data Foo = Foo { fooA :: Int, fooB :: Bool }
  -- make sure this is an instance of Generic
  deriving (Show, Generics)

-- Derive automatically
instance BlazeShow Foo

main :: IO ()
main = do
  let v = Foo 123 True
  print v
  S.putStrLn $ showBS v

About

An Alternative of Show class using blaze-builder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published