on dev help sign in
greaterThan ~> moreThan
commitd6ad73f4c3c8da92ccb61402424e9c06922804bb authorEitan Chatav <eitan@EEM109LMBP-1.local> dateThu 11 Jul 2019, 17:19 (7 years ago) parent466adc7
1 file changed+6−8
squeal-postgresql/src/Squeal/PostgreSQL/Expression/Range.hs+6−8
squeal-postgresql/src/Squeal/PostgreSQL/Expression/Range.hs+6−8
@@ -35,7 +35,7 @@ module Squeal.PostgreSQL.Expression.Range
3535 ( range
3636 , Range (..)
3737 , (<=..<=), (<..<), (<=..<), (<..<=)
38− , greaterThan, atLeast, lessThan, atMost
38+ , moreThan, atLeast, lessThan, atMost
3939 , singleton, whole
4040 , Bound (..)
4141 , closed, open
@@ -71,10 +71,8 @@ range ty = \case
7171 (commaSeparated [renderArg l, renderArg u, renderClopen l u])
7272 where
7373 renderArg (Bound _ x) = maybe "NULL" renderSQL x
74− clopenLeft = bool "(" "["
75− clopenRight = bool ")" "]"
7674 renderClopen (Bound l' _) (Bound u' _) =
77− "\'" <> clopenLeft l' <> clopenRight u' <> "\'"
75+ "\'" <> bool "(" "[" l' <> bool ")" "]" u' <> "\'"
7876
7977data Bound x = Bound
8078 { closedBound :: Bool
@@ -84,8 +82,8 @@ data Bound x = Bound
8482 , Functor, Foldable, Traversable )
8583 deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo)
8684closed, open :: Maybe x -> Bound x
87−closed x = Bound True x
88−open x = Bound False x
85+closed = Bound True
86+open = Bound False
8987
9088data Range x
9189 = Empty
@@ -103,8 +101,8 @@ x <..< y = NonEmpty (open (Just x)) (open (Just y))
103101x <=..< y = NonEmpty (closed (Just x)) (open (Just y))
104102x <..<= y = NonEmpty (open (Just x)) (closed (Just y))
105103
106−greaterThan, atLeast, lessThan, atMost :: x -> Range x
107−greaterThan x = NonEmpty (open (Just x)) (open Nothing)
104+moreThan, atLeast, lessThan, atMost :: x -> Range x
105+moreThan x = NonEmpty (open (Just x)) (open Nothing)
108106atLeast x = NonEmpty (closed (Just x)) (open Nothing)
109107lessThan x = NonEmpty (open Nothing) (open (Just x))
110108atMost x = NonEmpty (open Nothing) (closed (Just x))