diff options
Diffstat (limited to 'testsuite/tests/stranal/should_compile/str001.hs')
-rw-r--r-- | testsuite/tests/stranal/should_compile/str001.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/str001.hs b/testsuite/tests/stranal/should_compile/str001.hs new file mode 100644 index 0000000000..6d27a923fd --- /dev/null +++ b/testsuite/tests/stranal/should_compile/str001.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE DatatypeContexts #-} +module ShouldSucceed where + +{-# OPTIONS -O #-} + +newtype Num a => Point2 a = Point2 (a,a) + +area2 :: Num a => Point2 a -> Point2 a -> Point2 a -> a +area2 (Point2 (px,py)) (Point2 (qx,qy)) (Point2 (rx,ry)) + = (px-qx) * (py-ry) - (py-qy) * (px-rx) |