Follow

@wactbprot
Yes great lecture about calculus and .

When I tried to program the AND combinator in I failed. Maybe because of the static type system but more likely because of my inability?

Is there a simple solution for AND: (\p q -> p q p ) in ?

This is as far as I got:

tr :: a -> b -> a
tr = \p q -> p
fs :: a -> b -> b
fs = \p q -> q

and' = \p q -> p q fs
or' = \p q -> p tr q
-- ghci> or' tr fs True False
-- True
-- ghci> and' tr fs True False
-- False

-- and'' = \p q -> p q p -- does not work
-- or'' = \p q -> p p q -- does not work

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.