Created
          January 3, 2021 16:28 
        
      - 
      
- 
        Save Gabriella439/aef53d16d7418ba34b16aded0795333f to your computer and use it in GitHub Desktop. 
    Church-encoding of Bool type
  
        
  
    
      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
    
  
  
    
  | {-# LANGUAGE RankNTypes #-} | |
| import Prelude hiding (Bool(..)) | |
| type Bool = forall a . a -> a -> a | |
| false :: Bool | |
| false = \true_ false_ -> false_ | |
| true :: Bool | |
| true = \true_ false_ -> true_ | |
| ifThenElse :: Bool -> a -> a -> a | |
| ifThenElse b = b | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment