summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/str001.hs
blob: 6d27a923fd586438e5a78b05436d871457ff8ce4 (plain)
1
2
3
4
5
6
7
8
9
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)