Code Monkey home page Code Monkey logo

print's Introduction

Print

Build Status

Simple printing with Text. This is a prototype, not production code.

base             >= 4.6  && <4.10,
text             >= 1.2  && <1.3,
text-format      >= 0.3  && <0.4

Functions

Replaces the Prelude function show:

show :: Show a => a -> String

... with a new one that uses Text.

show :: Show a => a -> Text

Instances

A Text-based Show replacement can be derived with GHC's new -XDeriveAnyClass.

{-# LANGUAGE DeriveAnyClass #-}

data Animal 
  = Dog
  | Cat
  deriving (Generic, Print.Show)

GHCi

GHCI's default printing mechanism can be overloaded by adding the following to your .ghci file. Anything typed at the console will then use the modern print function instead of the Prelude.

import Print
:set -interactive-print=Print.print

Building

Stack (Recommended)

$ stack build
$ stack repl print:exe:Example

Cabal

$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal build
$ cabal repl exe:Example

print's People

Contributors

sdiehl avatar joe9 avatar

Stargazers

Sean Hagstrom avatar  avatar Hans Raaf avatar  avatar Paolo G. Giarrusso avatar  avatar Jon Schoning avatar Daniel Pous Montardit avatar Mitchell Dalvi Rosen avatar Andrew Darqui avatar  avatar

Watchers

Franklin Chen avatar James Cloos avatar  avatar  avatar  avatar

Forkers

joe9 matrixmike

print's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.