on master help sign in
Updated McCarthy's conditional
commit9b8a345c73bb6156dc6d245dcc9f59803cb0d44d authorArmando Santos <armandoifsantos@gmail.com> dateSat 1 Feb 2020, 14:17 (7 years ago) parente899b07
2 files changed+6−6
hackage.sh+1−1 src/LAoP/Relation/Internal.hs+5−5
hackage.sh+1−1
@@ -7,4 +7,4 @@ trap 'rm -r "$dir"' EXIT
77# assumes cabal 2.4 or later
88cabal v2-haddock --builddir="$dir" --haddock-for-hackage --enable-doc
99
10−cabal upload -d $dir/*-docs.tar.gz
10+cabal upload -d $dir/*-docs.tar.gz --publish
src/LAoP/Relation/Internal.hs+5−5
@@ -935,8 +935,8 @@ predR ::
935935 FromListsN a a,
936936 FromListsN Bool a
937937 )
938− => (a -> Bool) -> Relation a a
939−predR p = identity `intersection` divisionF (fromF' (const True)) (fromF' p)
938+ => Relation a Bool -> Relation a a
939+predR p = identity `intersection` divisionF (fromF' (const True)) p
940940
941941-- | Equalizes functions @f@ and @g@.
942942-- That is, @'equalizer' f g@ is the largest coreflexive
@@ -965,8 +965,8 @@ guard ::
965965 FromListsN b b,
966966 FromListsN Bool b,
967967 TrivialE b b
968− ) => (b -> Bool) -> Relation b (Either b b)
969−guard p = conv (eitherR (predR p) (predR (not . p)))
968+ ) => Relation b Bool -> Relation b (Either b b)
969+guard p = conv (eitherR (predR p) (predR (negate p)))
970970
971971-- | Relational McCarthy's conditional.
972972cond ::
@@ -977,7 +977,7 @@ cond ::
977977 FromListsN Bool b,
978978 TrivialE b b
979979 )
980− => (b -> Bool) -> Relation b c -> Relation b c -> Relation b c
980+ => Relation b Bool -> Relation b c -> Relation b c -> Relation b c
981981cond p r s = eitherR r s `comp` guard p
982982
983983-- | Relational domain.