Created
October 31, 2019 15:31
-
-
Save erikkaplun/f088dd16fbe4b9c41edb74910d1f3cfe to your computer and use it in GitHub Desktop.
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
/* | |
Source code is in UTF-8 encoding. The following symbols may appear, among others: | |
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ ς σ τ υ φ χ ψ ω « • ¦ » ∀ ∃ ∷ … → ← fi fl ƒ | |
If you can't read this, you're out of luck. This code was generated with the frege compiler version 3.24.100 | |
from /Users/erik/code/frege/frege-clj-mix/src/frege/frege_clj_mix/Fibonacci.fr Do not edit this file! | |
Instead, edit the source file and recompile. | |
*/ | |
import frege.run7.Func; | |
import frege.run7.Lazy; | |
import frege.run7.Thunk; | |
import frege.run.Kind; | |
import frege.run.RunTM; | |
import frege.runtime.Meta; | |
import frege.runtime.Phantom.RealWorld; | |
import frege.Prelude; | |
import frege.control.Category; | |
import frege.control.Semigroupoid; | |
import frege.java.IO; | |
import frege.java.Lang; | |
import frege.java.Util; | |
import frege.java.util.Regex; | |
import frege.prelude.Maybe; | |
import frege.prelude.PreludeArrays; | |
import frege.prelude.PreludeBase; | |
import frege.prelude.PreludeIO; | |
import frege.prelude.PreludeList; | |
import frege.prelude.PreludeMonad; | |
import frege.prelude.PreludeText; | |
@SuppressWarnings("unused") | |
@Meta.FregePackage( | |
source="/Users/erik/code/frege/frege-clj-mix/src/frege/frege_clj_mix/Fibonacci.fr", time=1572527891732L, | |
jmajor=1, jminor=7, | |
imps={ | |
"frege.Prelude", "frege.prelude.PreludeArrays", "frege.prelude.PreludeBase", "frege.prelude.PreludeIO", | |
"frege.prelude.PreludeList", "frege.prelude.PreludeMonad", "frege.prelude.PreludeText", "frege.java.util.Regex" | |
}, | |
nmss={"Prelude", "PreludeArrays", "PreludeBase", "PreludeIO", "PreludeList", "PreludeMonad", "PreludeText", "Regexp"}, | |
symas={}, symcs={}, symis={}, symts={}, | |
symvs={ | |
@Meta.SymV(offset=505, [email protected](pack="Fibonacci", base="main"), stri="s(u)", sig=1, depth=1, rkind=49), | |
@Meta.SymV(offset=91, [email protected](pack="Fibonacci", base="fibs"), stri="s(uu)", sig=3, depth=2, rkind=177), | |
@Meta.SymV(offset=381, [email protected](pack="Fibonacci", base="fib"), stri="s(u)", sig=5, depth=1, rkind=49), | |
@Meta.SymV(offset=263, [email protected](pack="Fibonacci", base="fibonacci"), stri="u", sig=6, depth=0, rkind=36) | |
}, | |
symls={}, | |
taus={ | |
@Meta.Tau(kind=2, suba=0, tcon={@Meta.QName(kind=0, pack="frege.prelude.PreludeBase", base="[]")}), | |
@Meta.Tau(kind=2, suba=0, tcon={@Meta.QName(kind=0, pack="frege.prelude.PreludeBase", base="StringJ")}), | |
@Meta.Tau(kind=2, suba=0, tcon={@Meta.QName(kind=0, pack="frege.prelude.PreludeBase", base="Char")}), | |
@Meta.Tau(kind=0, suba=1, subb=2), @Meta.Tau(kind=0, suba=0, subb=3), | |
@Meta.Tau(kind=2, suba=0, tcon={@Meta.QName(kind=0, pack="frege.prelude.PreludeBase", base="ST")}), | |
@Meta.Tau(kind=2, suba=0, tcon={@Meta.QName(kind=0, pack="frege.prelude.PreludeBase", base="RealWorld")}), | |
@Meta.Tau(kind=0, suba=5, subb=6), | |
@Meta.Tau(kind=2, suba=0, tcon={@Meta.QName(kind=0, pack="frege.prelude.PreludeBase", base="()")}), | |
@Meta.Tau(kind=0, suba=7, subb=8), @Meta.Tau(kind=9), @Meta.Tau(suba=10, tvar="α"), | |
@Meta.Tau(kind=0, suba=0, subb=11), | |
@Meta.Tau(kind=2, suba=0, tcon={@Meta.QName(kind=0, pack="frege.prelude.PreludeBase", base="Long")}), | |
@Meta.Tau(kind=0, suba=0, subb=13) | |
}, | |
rhos={ | |
@Meta.Rho(rhofun=false, rhotau=4), @Meta.Rho(rhofun=false, rhotau=9), @Meta.Rho(sigma=0, rhotau=1), | |
@Meta.Rho(rhofun=false, rhotau=11), @Meta.Rho(rhofun=false, rhotau=12), @Meta.Rho(sigma=2, rhotau=4), | |
@Meta.Rho( | |
cont={@Meta.Context([email protected](kind=0, pack="frege.prelude.PreludeBase", base="Num"), tau=11)}, sigma=2, | |
rhotau=5 | |
), | |
@Meta.Rho(rhofun=false, rhotau=13), @Meta.Rho(sigma=4, rhotau=7), @Meta.Rho(rhofun=false, rhotau=14) | |
}, | |
sigmas={ | |
@Meta.Sigma(rho=0), @Meta.Sigma(rho=2), @Meta.Sigma(rho=3), @Meta.Sigma(bound={"α"}, kinds={10}, rho=6), | |
@Meta.Sigma(rho=7), @Meta.Sigma(rho=8), @Meta.Sigma(rho=9) | |
}, | |
exprs={@Meta.Expr()} | |
) | |
final public class Fibonacci { | |
final public static <α> PreludeBase.TList<α> fibs(final PreludeBase.CNum<α> ctx$1, final Lazy<α> arg$1, final Lazy<α> arg$2) { | |
return PreludeBase.TList.DCons.<α>mk( | |
arg$1, | |
Thunk.<PreludeBase.TList<α>>shared( | |
new Lazy.D<PreludeBase.TList<α>>() { | |
public PreludeBase.TList<α> call() { | |
return Fibonacci.<α>fibs( | |
ctx$1, arg$2, | |
Thunk.<α>shared(new Lazy.D<α>() {public α call() {return ctx$1.ƒ$plus(arg$1, arg$2);}}) | |
); | |
} | |
} | |
) | |
); | |
} | |
final public static Lazy<PreludeBase.TList<Long>> fibonacci = Thunk.<PreludeBase.TList<Long>>shared( | |
new Lazy.D<PreludeBase.TList<Long>>() { | |
public PreludeBase.TList<Long> call() { | |
return Fibonacci.<Long>fibs(PreludeBase.INum_Long.it, Thunk.<Long>lazy(0L), Thunk.<Long>lazy(1L)); | |
} | |
} | |
); | |
final public static long fib(final Lazy<Long> arg$1) { | |
return (long)PreludeBase.<Long, PreludeBase.TList<Long>>$( | |
new Func.U.D<PreludeBase.TList<Long>, Long>() { | |
public Lazy<Long> apply(final Lazy<PreludeBase.TList<Long>> η$7635) { | |
return Thunk.<Long>shared( | |
new Lazy.D<Long>() { | |
public Long call() { | |
return PreludeList.IListView_$lbrack$rbrack.<Long>head(η$7635.call()); | |
} | |
} | |
); | |
} | |
}, | |
Thunk.<PreludeBase.TList<Long>>nested( | |
new Lazy.D<Lazy<PreludeBase.TList<Long>>>() { | |
public Lazy<PreludeBase.TList<Long>> call() { | |
return PreludeBase.<PreludeBase.TList<Long>, PreludeBase.TList<Long>>$( | |
new Func.U.D<PreludeBase.TList<Long>, PreludeBase.TList<Long>>() { | |
public Lazy<PreludeBase.TList<Long>> apply(final Lazy<PreludeBase.TList<Long>> η$7636) { | |
return Thunk.<PreludeBase.TList<Long>>shared( | |
new Lazy.D<PreludeBase.TList<Long>>() { | |
public PreludeBase.TList<Long> call() { | |
return PreludeList.IListView_$lbrack$rbrack.< | |
Long | |
>drop((int)((long)arg$1.call()), η$7636); | |
} | |
} | |
); | |
} | |
}, | |
Fibonacci.fibonacci | |
); | |
} | |
} | |
) | |
).call(); | |
} | |
final public static Func.U<RealWorld, Short> $main(final Lazy<PreludeBase.TList<String/*<Character>*/>> arg$1) { | |
return PreludeMonad.IMonad_ST.<RealWorld, Short, Short>$gt$gt( | |
Prelude.<String/*<Character>*/>print(PreludeText.IShow_String.it, "Fibonacci 12 = "), | |
Thunk.<Func.U<RealWorld, Short>>nested( | |
new Lazy.D<Lazy<Func.U<RealWorld, Short>>>() { | |
public Lazy<Func.U<RealWorld, Short>> call() { | |
return PreludeBase.<Func.U<RealWorld, Short>, Long>$( | |
new Func.U.D<Long, Func.U<RealWorld, Short>>() { | |
public Lazy<Func.U<RealWorld, Short>> apply(final Lazy<Long> η$7637) { | |
return Thunk.<Func.U<RealWorld, Short>>shared( | |
new Lazy.D<Func.U<RealWorld, Short>>() { | |
public Func.U<RealWorld, Short> call() { | |
return Prelude.<Long>println(PreludeText.IShow_Long.it, (long)η$7637.call()); | |
} | |
} | |
); | |
} | |
}, | |
Thunk.<Long>shared( | |
new Lazy.D<Long>() { | |
public Long call() { | |
return Fibonacci.fib(Thunk.<Long>lazy(12L)); | |
} | |
} | |
) | |
); | |
} | |
} | |
) | |
); | |
} | |
public static void main(final java.lang.String[] argv) { | |
try { | |
frege.run.RunTM.argv = argv; | |
PreludeBase.TST.<Short>performUnsafe($main | |
(Thunk.lazy(PreludeArrays.IListSource_JArray.<String/*<Character>*/>toList(argv))) | |
).call(); | |
frege.runtime.Runtime.stdout.get().close(); | |
frege.runtime.Runtime.stderr.get().close(); | |
} finally { frege.run.Concurrent.shutDownIfExists(); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment