Skip to content

Instantly share code, notes, and snippets.

@pocketberserker
Created November 5, 2014 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pocketberserker/4b748d75835737bf4d82 to your computer and use it in GitHub Desktop.
Save pocketberserker/4b748d75835737bf4d82 to your computer and use it in GitHub Desktop.
コンピュテーション式でAAを表現したかったのじゃ…
open System.Reflection
type Line1 = Line1
type Line2 = Line2
type Line3 = Line3
type Line4 = Line4
type Line5 = Line5
type Line6 = Line6
type Line7 = Line7
type Line8 = Line8
type Line9 = Line9
type Line10 = Line10
type Line11 = Line11
type Line12 = Line12
type Line13 = Line13
type Line14 = Line14
type Line15 = Line15
type Line16 = Line16
let inline operatorName () =
(MethodBase.GetCurrentMethod().GetCustomAttribute(typeof<CustomOperationAttribute>) :?> CustomOperationAttribute).Name
type SavannahBuilder() =
member __.Delay(f: unit -> _) = f
member __.Run(f: unit -> Line16 * string list) =
f ()
|> snd
|> List.rev
|> List.fold (sprintf "%s\n%s") "output:"
|> printfn "%s"
member __.Yield(x) = x
[<CustomOperation("         ,、,, ,、,, ,, ,,")>]
member __.Line1(()) = (Line1, [ operatorName () ])
[<CustomOperation("       _,,;' '\" '' ゛''\" ゛' ';;,,")>]
member __.Line2((Line1, xs)) = (Line2, operatorName () :: xs)
[<CustomOperation("      (rヽ,;''\"\"\"''゛゛゛'';, ノr)")>]
member __.Line3((Line2, xs)) = (Line3, operatorName () :: xs)
[<CustomOperation("      ,;'゛ i _  、_ iヽ゛';,    テスト書いてないとかお前それ")>]
member __.Line4((Line3, xs)) = (Line4, operatorName () :: xs)
[<CustomOperation("      ,;'\" ''| ヽ・〉 〈・ノ |゙゛ `';,  t-wadaの前でも")>]
member __.Line5((Line4, xs)) = (Line5, operatorName () :: xs)
[<CustomOperation("      ,;'' \"|   ▼   |゙゛ `';,   同じこと言えんの?")>]
member __.Line6((Line5, xs)) = (Line6, operatorName () :: xs)
[<CustomOperation("      ,;''  ヽ_人_ /  ,;'_")>]
member __.Line7((Line6, xs)) = (Line7, operatorName () :: xs)
[<CustomOperation("     /シ、  ヽ⌒⌒ /   リ \")>]
member __.Line8((Line7, xs)) = (Line8, operatorName () :: xs)
[<CustomOperation("    |   \"r,, `\"'''゙´  ,,ミ゛   |")>]
member __.Line9((Line8, xs)) = (Line9, operatorName () :: xs)
[<CustomOperation("    |      リ、    ,リ    |")>]
member __.Line10((Line9, xs)) = (Line10, operatorName () :: xs)
[<CustomOperation("    |   i   ゛r、ノ,,r\" i   _|")>]
member __.Line11((Line10, xs)) = (Line11, operatorName () :: xs)
[<CustomOperation("    |   `ー――----┴ ⌒´ )")>]
member __.Line12((Line11, xs)) = (Line12, operatorName () :: xs)
[<CustomOperation("    (ヽ  ______ ,, _´)")>]
member __.Line13((Line12, xs)) = (Line13, operatorName () :: xs)
[<CustomOperation("     (_⌒ ______ ,, ィ")>]
member __.Line14((Line13, xs)) = (Line14, operatorName () :: xs)
[<CustomOperation("      丁           |")>]
member __.Line15((Line14, xs)) = (Line15, operatorName () :: xs)
[<CustomOperation("       |           |")>]
member __.Line16((Line15, xs)) = (Line16, operatorName () :: xs)
let savannah = SavannahBuilder()
savannah {
``         ,、,, ,、,, ,, ,,``
``       _,,;' '" '' ゛''" ゛' ';;,,``
``      (rヽ,;''"""''゛゛゛'';, ノr)``
``      ,;'゛ i _  、_ iヽ゛';,    テスト書いてないとかお前それ``
``      ,;'" ''| ヽ・〉 〈・ノ |゙゛ `';,  t-wadaの前でも``
``      ,;'' "|   ▼   |゙゛ `';,   同じこと言えんの?``
``      ,;''  ヽ_人_ /  ,;'_``
``     /シ、  ヽ⌒⌒ /   リ \``
``    |   "r,, `"'''゙´  ,,ミ゛   |``
``    |      リ、    ,リ    |``
``    |   i   ゛r、ノ,,r" i   _|``
``    |   `ー――----┴ ⌒´ )``
``    (ヽ  ______ ,, _´)``
``     (_⌒ ______ ,, ィ``
``      丁           |``
``       |           |``
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment