Add crash implementation to document compiler bug
parent
4c9edbfadb
commit
85c9d31950
@ -0,0 +1,23 @@
|
|||||||
|
app "crash-me"
|
||||||
|
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.7.1/Icc3xJoIixF3hCcfXrDwLCu4wQHtNdPyoJkEbkgIElA.tar.br" }
|
||||||
|
imports [pf.Stdout]
|
||||||
|
provides [main] to pf
|
||||||
|
|
||||||
|
main =
|
||||||
|
fn1 = bind Num.sub 2
|
||||||
|
fn2 = compose fn1 fn1
|
||||||
|
|
||||||
|
results =
|
||||||
|
[fn1, fn2]
|
||||||
|
|> List.map \f -> f 2
|
||||||
|
|> List.map Num.toStr
|
||||||
|
|> Str.joinWith "\n"
|
||||||
|
Stdout.line "$(results)"
|
||||||
|
|
||||||
|
bind : (a, b -> c), a -> (b -> c)
|
||||||
|
bind = \fn, a ->
|
||||||
|
\b -> fn a b
|
||||||
|
|
||||||
|
compose : (a -> b), (b -> c) -> (a -> c)
|
||||||
|
compose = \fn1, fn2 ->
|
||||||
|
\a -> fn1 a |> fn2
|
Loading…
Reference in New Issue