Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@esehara
Created October 6, 2016 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esehara/2e32a6cf85dc261216d1f8efe9c0bdf4 to your computer and use it in GitHub Desktop.
Save esehara/2e32a6cf85dc261216d1f8efe9c0bdf4 to your computer and use it in GitHub Desktop.
ふぃしゅっしゅ数 Ver 1.0 Haskell Ver
ack_like 0 n f = f n
ack_like m 0 f = ack_like (m - 1) 1 f
ack_like m n f = ack_like (m - 1) (ack_like m (n - 1) f) f
s_func_conv f = \x -> ack_like x x f
s_conv (m, f) = ((g m), g)
where
g = s_func_conv f
ss_s2_conv s = \(m, f) -> (iterate s (m, f)) !! f(m)
ss_conv (m, f, s) = (x, y, ss_s2)
where
ss_s2 = ss_s2_conv s
(x, y) = ss_s2 (m, f)
main =
putStrLn $ show $ result
where
(result, _, _) = iterate ss_conv (3, \x -> x + 1, \pair -> s_conv pair) !! 63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment