Created
June 7, 2019 05:30
-
-
Save hanachin/9dfe08bc037e3421b453dc2179795f6b to your computer and use it in GitHub Desktop.
stackoverflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@stage: 0 | |
let-rec seq-int s e = | |
let-rec r n = | |
&( | |
if ~n > ~e then | |
[] | |
else | |
~n :: ~(r &(~n + 1)) | |
) | |
in | |
&(fun -> ( | |
if ~e == ~s then | |
[~s] | |
else if ~e < ~s then | |
[] | |
else | |
~(r s) | |
)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@stage: 1 | |
@require: stdja | |
@require: list | |
@import: sequence0 | |
let-inline \example = | |
~(seq-int &1 &5) | |
|> List.map (fun i -> (arabic i)) | |
|> List.fold-left (fun acc s -> acc ^ s) ` ` | |
|> embed-string | |
in | |
document (| | |
author = { Seiei MIYAGI }; | |
show-title = true; | |
show-toc = false; | |
title = { SATySFiで数列 } | |
|) '< | |
+p { \example; } | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment