This is a fairly common question, and there isn't a One True Answer.
These are the most common techniques:
| -1 0 1 2 3 4 5 | |
| \ / \\/ \ / \ / | |
| \ // \ / | |
| \ // \ / | |
| \\ / | |
| \\ / | |
| \\ / | |
| \\/ | |
| // | |
| // |
| {-# LANGUAGE FlexibleInstances, DeriveFunctor #-} | |
| import Control.Applicative | |
| import Data.Unfolder | |
| import Data.Unfoldable | |
| import Data.Ratio | |
| import Test.QuickCheck hiding (choose) | |
| class Polynomial p where |
| import Control.Monad | |
| import Control.Monad.Random | |
| data RPS = Rock | Paper | Scissors | |
| deriving (Show, Eq, Read) | |
| data Result = Win | Lose | Tie | |
| deriving (Show, Eq) | |