Open
Description
Consider the following code:
module Main (main) where
import Prelude hiding ((<>))
import Text.PrettyPrint
main :: IO ()
main = do
let s1 = text "if:" $+$ nest 4 (text "pass")
let s2 = text "if:\n pass"
let f = (text "x" <>)
--not following Eq's Substitutivity 'law':
--first is True but second is False
print $ s1 == s2
print $ f s1 == f s2
--examine the values visually:
print $ s1
print $ s2
print $ f s1
print $ f s2
--outputs the following (note extra space in the 3rd):
-- if:
-- pass
-- if:
-- pass
-- xif:
-- pass
-- xif:
-- pass
If this is not the intended behavior of the various functions involved (<>,
Metadata
Metadata
Assignees
Labels
No labels