Commit 310a42c7 authored by Steffen Michels's avatar Steffen Michels

fix problem with instances of Either

parent b2512fd2
Pipeline #19720 passed with stage
in 4 minutes and 39 seconds
......@@ -27,23 +27,3 @@ instance == CadastreRealEstate
yields True only if @a.address < @b.address.
*/
instance < CadastreRealEstate
/** == (Left a) (Left b):
yields @a == @b.
== (Right a) (Right b):
yields @a == @b.
== _ _:
yields False.
*/
instance == (Either a b) | Eq a & Eq b
/** < (Left a) (Left b):
yields @a < @b.
< (Right a) (right b):
yields @a < @b.
< (Left _) _:
yields True.
< _ _:
yields False.
*/
instance < (Either a b) | Ord a & Ord b
implementation module Cadastre.UoD
import CivilAffairs.UoD, ChamberOfCommerce.UoD
from Data.Either import :: Either(..)
import Data.Either
derive class iTask CadastreRealEstate
instance == CadastreRealEstate where == a1 a2 = a1.CadastreRealEstate.address == a2.CadastreRealEstate.address
instance < CadastreRealEstate where < a1 a2 = a1.CadastreRealEstate.address < a2.CadastreRealEstate.address
instance == (Either a b) | Eq a & Eq b where == (Left a) (Left b) = a == b
== (Right a) (Right b) = a == b
== _ _ = False
instance < (Either a b) | Ord a & Ord b where < (Left a) (Left b) = a < b
< (Left _) _ = True
< (Right a) (Right b) = a < b
< _ _ = False
......@@ -3,6 +3,7 @@ implementation module Compensation.UoD
import Cadastre.UoD
import iTasks.Extensions.DateTime, Data.Maybe
from Data.Either import :: Either(..)
import Data.Either.Ord
decisionsAfter :: SSN (DecisionStatus -> Bool) Date [Decision] -> [Decision]
decisionsAfter ssn cond date decisions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment