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
568405b0
Commit
568405b0
authored
Nov 12, 2020
by
Ari Nugraha
Browse files
implement for input number 0-9
parent
e6fa7b6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Language/Lambda/Parser.hs
View file @
568405b0
...
...
@@ -9,7 +9,7 @@ import Text.Parsec.String
import
Language.Lambda.Expression
parseExpr
::
String
->
Either
ParseError
(
LambdaExpr
String
)
parseExpr
=
parse
(
whitespace
*>
expr
<*
eof
)
""
parseExpr
kata
=
parse
(
whitespace
*>
expr
<*
eof
)
""
(
doOperation
kata
)
expr
::
Parser
(
LambdaExpr
String
)
expr
=
try
app
<|>
term
...
...
@@ -52,6 +52,9 @@ symbol = void . lexeme . char
keyword
::
String
->
Parser
()
keyword
=
void
.
lexeme
.
string
doOperation
""
=
""
doOperation
(
x
:
xs
)
=
ubahKeChurch
x
++
doOperation
xs
ubahKeChurch
::
Char
->
[
Char
]
ubahKeChurch
'+'
=
"(
\\
w y x. y (w y x))"
ubahKeChurch
'*'
=
"(
\\
x y z . x (y z))"
...
...
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