Personal tools

Chaitin's construction/Combinatory logic

From HaskellWiki

< Chaitin's construction(Difference between revisions)
Jump to: navigation, search
(Lifting section hierarchy)
Current revision (14:34, 4 August 2006) (edit) (undo)
m (table of contents and categorising under Category:Theoretical foundations)
 
Line 1: Line 1:
 +
__TOC__
 +
Combinatory logic term modules
Combinatory logic term modules
Line 42: Line 44:
ess = S
ess = S
</haskell>
</haskell>
 +
 +
[[Category:Theoretical foundations]]

Current revision

Contents


Combinatory logic term modules

1 CL

module CL (CL, k, s, apply) where
 
 import Tree (Tree (Leaf, Branch))
 import BaseSymbol (BaseSymbol, kay, ess)
 
 type CL = Tree BaseSymbol 
 
 k, s :: CL
 k = Leaf kay
 s = Leaf ess
 
 apply :: CL -> CL -> CL
 apply = Branch

2 CL extension

module CLExt ((>>@)) where
 
 import CL (CL, apply)
 import Control.Monad (Monad, liftM2)
 
 (>>@) :: Monad m => m CL -> m CL -> m CL
 (>>@) = liftM2 apply

3 Base symbol

module BaseSymbol (BaseSymbol, kay, ess) where
 
 data BaseSymbol = K | S
 
 kay, ess :: BaseSymbol
 kay = K
 ess = S