Open shinjiroy opened 4 years ago
I wrote and sent this code in Try Elm(https://elm-lang.org/try).
import Html exposing (Html, text, div, h1, table, thead, tr, th, tbody, td) main = div [] [ h1 [] [ text "Lambda Calculus"], table [] [ thead [] [ tr [] [ th [] [ text "Input" ], th [] [ text "Output" ] ] ], tbody [] [ outTr "sub C3 C2" (resultChuNum (sub c3 c2)) ] ] ] outTr = \fncNam -> \rst -> tr [] [ td [] [ text fncNam ], td [] [ text rst ] ] resultBool = \b -> (\l -> \m -> \n -> l m n) b "true" "false" tru = \t -> \f -> t fls = \t -> \f -> f and = \b -> \c -> b c fls or = \b -> \c -> b tru c not = \b -> b fls tru pair = \f -> \s -> \b -> b f s fst = \p -> p tru snd = \p -> p fls testPair = pair "first" "second" c0 = \s -> \z -> z c1 = \s -> \z -> s z c2 = \s -> \z -> s (s z) c3 = \s -> \z -> s (s (s z)) scc = \n -> \s -> \z -> s (n s z) resultChuNum = \chur -> String.fromInt (chur (\n -> n + 1) 0) plus = \m -> \n -> m scc n times = \m -> \n -> m (plus n) c0 pow = \m -> \n -> m n iszro = \m -> m (\x -> fls) tru zz = pair c0 c0 ss = \p -> pair (snd p) (plus c1 (snd p)) prd = \m -> fst (m ss zz) sub = \m -> \n -> n prd m
Then this error occured.
Only function "sub" causes this error. Other functions don't cause this error.
Environment Windows 10 Pro Google Chrome 81.0.4044.129
I wrote and sent this code in Try Elm(https://elm-lang.org/try).
Then this error occured.
Only function "sub" causes this error. Other functions don't cause this error.
Environment Windows 10 Pro Google Chrome 81.0.4044.129