Created
April 1, 2025 14:36
-
-
Save ClarkeRemy/204280929ecb22ffd842805d2216a2b5 to your computer and use it in GitHub Desktop.
Bad Typeclass Prolog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fAtoB_optionA_optionB(_, none, none). | |
fAtoB_optionA_optionB(F, option(A), option(B)) :- C =.. [F,A,B], C. | |
functor_map(option, fAtoB_optionA_optionB). | |
fmapAtoB_fA_fB(Func, F_A, F_B) :- | |
( nonvar(F_A) -> F_A =.. [F| _] | |
; nonvar(F_B) -> F_B =.. [F| _] | |
), | |
functor_map(F, Map), | |
C =.. [Map, Func, F_A, F_B], | |
C. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment