From 94ffa913d114cc66ec4cb1963fe10d7cf477e0ca Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Sun, 12 Mar 2023 11:03:51 +0100 Subject: 3_b_9: Add solution --- ch03/3_b_9.hs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 ch03/3_b_9.hs (limited to 'ch03/3_b_9.hs') diff --git a/ch03/3_b_9.hs b/ch03/3_b_9.hs new file mode 100644 index 0000000..c6595de --- /dev/null +++ b/ch03/3_b_9.hs @@ -0,0 +1,9 @@ +-- Consider three two-dimensional points a, b, and c. If we look at the angle +-- formed by the line segment from a to b and the line segment from b to c, it +-- either turns left, turns right, or forms a straight line. Define a Direction +-- data type that lets you represent these possibilities. + +data Direction = DLeft + | DRight + | DStraight + deriving (Show) -- cgit v1.2.3