Fakultas Ilmu Komputer UI

Commit d1a6605a authored by Ari Nugraha's avatar Ari Nugraha
Browse files

add conversion from number to church numeral

parent ff34b261
-- This file has been generated from package.yaml by hpack version 0.21.2. cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --
-- hash: f7f43eaf08f4a2a78ad4d303404ea19c729aa53a0afa30fd0f99d8eb505b8306 -- hash: 3027a1ad5b882123e9547c30e72a7f9fa49104af48efc12d5e7817927129e600
name: lambda-calculator name: lambda-calculator
version: 2.0.0 version: 2.0.0
...@@ -17,7 +19,6 @@ copyright: 2016 Sean Gillespie ...@@ -17,7 +19,6 @@ copyright: 2016 Sean Gillespie
license: MIT license: MIT
license-file: LICENSE license-file: LICENSE
build-type: Simple build-type: Simple
cabal-version: >= 1.10
source-repository head source-repository head
type: git type: git
......
...@@ -51,3 +51,18 @@ symbol = void . lexeme . char ...@@ -51,3 +51,18 @@ symbol = void . lexeme . char
keyword :: String -> Parser () keyword :: String -> Parser ()
keyword = void . lexeme . string keyword = void . lexeme . string
ubahKeChurch :: Char -> [Char]
ubahKeChurch '+' = "(\\w y x. y (w y x))"
ubahKeChurch '*' = "(\\x y z . x (y z))"
ubahKeChurch '0' = "(\\s z. z)"
ubahKeChurch '1' = "(\\s z. s z)"
ubahKeChurch '2' = "(\\s z. s (s z))"
ubahKeChurch '3' = "(\\s z. s (s (s z)))"
ubahKeChurch '4' = "(\\s z. s (s (s (s z))))"
ubahKeChurch '5' = "(\\s z. s (s (s (s (s z)))))"
ubahKeChurch '6' = "(\\s z. s (s (s (s (s (s z))))))"
ubahKeChurch '7' = "(\\s z. s (s (s (s (s (s (s z)))))))"
ubahKeChurch '8' = "(\\s z. s (s (s (s (s (s (s (s z))))))))"
ubahKeChurch '9' = "(\\s z. s (s (s (s (s (s (s (s (s z)))))))))"
ubahKeChurch x = [x]
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages:
- completed:
hackage: Shellac-0.9.9@sha256:3ffcc6aa147ae304774ddde0cd56e92f8d913f12d2e4a7d7fc0e66b7019007db,1984
pantry-tree:
size: 918
sha256: 3c976e2387a598452163f65a14b2cce9f2ffe0e5cc15e15ada173d34cbcdc465
original:
hackage: Shellac-0.9.9
- completed:
hackage: Shellac-haskeline-0.2.1@sha256:c0fe9917222253f24738fe1feda8150625a4b5034bb21757ae8eba8d92760a10,1052
pantry-tree:
size: 244
sha256: 4f98a09ec110da209e58f809b7015448426430014fbd1d15366809a94b3533b9
original:
hackage: Shellac-haskeline-0.2.1
snapshots:
- completed:
size: 567342
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/10/3.yaml
sha256: b3d22b89ec630597ad007088e98aa1c8d04844b6c0f23970b513a2862e0b8f0a
original: lts-10.3
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment