Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ari Angga Nugraha
ariangganugraha-funpro2020-lambda
Commits
d1a6605a
Commit
d1a6605a
authored
Nov 11, 2020
by
Ari Nugraha
Browse files
add conversion from number to church numeral
parent
ff34b261
Changes
3
Hide whitespace changes
Inline
Side-by-side
lambda-calculator.cabal
View file @
d1a6605a
-- 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
--
-- hash:
f7f43eaf08f4a2a78ad4d303404ea19c729aa53a0afa30fd0f99d8eb505b8306
-- hash:
3027a1ad5b882123e9547c30e72a7f9fa49104af48efc12d5e7817927129e600
name: lambda-calculator
version: 2.0.0
...
...
@@ -17,7 +19,6 @@ copyright: 2016 Sean Gillespie
license: MIT
license-file: LICENSE
build-type: Simple
cabal-version: >= 1.10
source-repository head
type: git
...
...
src/Language/Lambda/Parser.hs
View file @
d1a6605a
...
...
@@ -51,3 +51,18 @@ symbol = void . lexeme . char
keyword
::
String
->
Parser
()
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
]
stack.yaml.lock
0 → 100644
View file @
d1a6605a
# 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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment