summaryrefslogtreecommitdiff
path: root/lib/SuperOrd.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-04-25 15:35:56 -0400
committerjoe <joe@jerkface.net>2016-04-25 15:37:45 -0400
commita16dfe2b23349ab8b66e33559fbd372f1c4832db (patch)
treebf8093c66424035a474cf27334aaf6bb57610714 /lib/SuperOrd.hs
parent35edce91c66282a053e80eb419876d258b373725 (diff)
Integrated CommandLine parsing library.
Diffstat (limited to 'lib/SuperOrd.hs')
-rw-r--r--lib/SuperOrd.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/SuperOrd.hs b/lib/SuperOrd.hs
new file mode 100644
index 0000000..258a823
--- /dev/null
+++ b/lib/SuperOrd.hs
@@ -0,0 +1,23 @@
1module SuperOrd where
2
3data SuperOrd a
4 = NegativeInfinity
5 | SuperOrd { superApprox :: !a
6 , superCompareApprox :: !Ordering
7 }
8 | PositiveInfinity
9 deriving (Eq, Ord, Show)
10
11instance Bounded (SuperOrd a) where
12 minBound = NegativeInfinity
13 maxBound = PositiveInfinity
14
15exactly :: a -> SuperOrd a
16exactly a = SuperOrd a EQ
17
18lessThan :: a -> SuperOrd a
19lessThan a = SuperOrd a LT
20
21greaterThan :: a -> SuperOrd a
22greaterThan a = SuperOrd a GT
23