generated from tpl/purs
fix: functor
This commit is contained in:
parent
2d4613590f
commit
3aa6dd1576
@ -15,6 +15,10 @@ data Bound a
|
||||
= BoundIncluding a
|
||||
| BoundExcluding a
|
||||
|
||||
instance Functor Bound where
|
||||
map f (BoundIncluding a) = BoundIncluding $ f a
|
||||
map f (BoundExcluding a) = BoundExcluding $ f a
|
||||
|
||||
derive instance Generic (Bound a) _
|
||||
derive instance Ord a => Ord (Bound a)
|
||||
derive instance Eq a => Eq (Bound a)
|
||||
@ -44,6 +48,11 @@ derive instance Eq a => Eq (Range a)
|
||||
instance Show a => Show (Range a) where
|
||||
show = genericShow
|
||||
|
||||
instance Functor Range where
|
||||
map f (RangeAbove b) = RangeAbove $ map f b
|
||||
map f (RangeBelow b) = RangeBelow $ map f b
|
||||
map f (RangeBetween a b) = RangeBetween (map f a) (map f b)
|
||||
|
||||
instance Semigroup (Range a) where
|
||||
append (RangeAbove a) (RangeBelow b) = RangeBetween a b
|
||||
append (RangeBelow a) (RangeAbove b) = RangeBetween a b
|
||||
|
Loading…
Reference in New Issue
Block a user