[Haskell-cafe] Slightly Offtopic in Part

Stefan O'Rear stefanor at cox.net
Fri Feb 8 21:59:54 EST 2008


On Fri, Feb 08, 2008 at 06:47:51PM -0800, Ryan Ingram wrote:
> I'm assuming you mean the rule described in
> http://en.wikibooks.org/wiki/Formal_Logic/Sentential_Logic/Inference_Rules
> 
> > type Disj a b = Either a b
> 
> > disj_elim :: Disj a b -> (a -> c) -> (b -> c) -> c
> > disj_elim (Left a) a2c b2c = a2c a
> > disj_elim (Right b) a2c b2c = b2c b
> 
> If you know "either a is true, or b is true"
> and you know "from a, I can prove c",
> and you know "from b, I can prove c",
> then you can prove c.

aka:

import Data.Either

type Disj = Either
disj_elim = either

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080208/c46c0d62/attachment.bin


More information about the Haskell-Cafe mailing list