Copyright | (c) Dennis Gosnell 2016 |
---|---|
License | BSD-style (see LICENSE file) |
Maintainer | cdep.illabout@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
Examples
Simple Haskell datatype:
>>>
data Foo a = Foo a String deriving Show
>>>
pPrint $ Foo 3 "hello"
Foo 3 "hello"
Lists:
>>>
pPrint $ [1,2,3]
[ 1 , 2 , 3 ]
Slightly more complicated lists:
>>>
pPrint $ [ Foo [ (), () ] "hello" ]
[ Foo [ () , () ] "hello" ]
>>>
pPrint $ [ Foo [ "bar", "baz" ] "hello", Foo [] "bye" ]
[ Foo [ "bar" , "baz" ] "hello" , Foo [] "bye" ]
Record:
>>>
:{
data Bar b = Bar { barInt :: Int , barA :: b , barList :: [Foo Double] } deriving Show :}
>>>
pPrint $ Bar 1 [10, 11] [Foo 1.1 "", Foo 2.2 "hello"]
Bar { barInt = 1 , barA = [ 10 , 11 ] , barList = [ Foo 1.1 "" , Foo 2.2 "hello" ] }