This file contains 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
{- js | |
const add1 = (a) => a + 1 | |
const times2 = (a) => a * 2 | |
const compose = (a, b) => (c) => a(b(c)) | |
const add1OfTimes2 = compose(add1, times2) | |
add1OfTimes2(5) // => 11 | |
-} | |
add1 = (+) 1 | |
times2 = (*) 2 | |
add1OfTimes2 = add1 << times2 |
This file contains 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
module Phoenix.Presence exposing (Presence, create, onChange, onJoins, onLeaves) | |
import Dict exposing (Dict) | |
import Json.Decode as JD exposing (Decoder, Value) | |
type alias Presence msg = | |
PhoenixPresence msg | |
This file contains 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
type t = { | |
test: string, | |
value: int | |
}; | |
external consume_client: string => t = "JSON.parse" [@@bs.val]; | |
external prepare_server: t => string = "JSON.stringify" [@@bs.val]; |
This file contains 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
function exponents_helper(curr_sum::Int, target_sum::Int, remaining_elements::Int)::Vector{Vector{Int}} | |
if remaining_elements == 0 | |
return [[]] | |
end | |
if curr_sum == target_sum | |
return [zeros(Int, remaining_elements)] | |
end | |
if remaining_elements == 1 | |
return map(x-> [x], 0:(target_sum - curr_sum)) |
This file contains 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
module Experiment1 = { | |
type t = | |
| Disabled | |
| Control | |
| VarA | |
| VarB; | |
let equal a b => | |
switch (a, b) { | |
| (Disabled, Disabled) => true | |
| (Control, Control) => true |
This file contains 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
# This works | |
# mod.ml is some ocaml code | |
# modwrap.c is a wrapper which calls the registered callbacks | |
# libasmrun is a runtime library | |
simplewrapper: | |
ocamlopt -output-obj -o modcaml.o mod.ml | |
ocamlc -c modwrap.c ;\ | |
cp `ocamlc -where`/libasmrun.a libmod.a && chmod +w libmod.a ;\ | |
ar r libmod.a modcaml.o modwrap.o |
This file contains 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
``` | |
gobi_install ctypes-ios | |
Switch to 4.04.0+ios+arm64 | |
The following actions will be performed: | |
∗ install libffi-sys-ios 3.2.1 [required by ctypes-ios] | |
∗ install ctypes-ios 0.11.2 | |
===== ∗ 2 ===== | |
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 🐫 | |
[ctypes-ios.0.11.2] https://github.com/ocamllabs/ocaml-ctypes/archive/0.11.2.tar.gz downloaded |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
module type MyFunctorReturnType = {let myFunc: unit => string;}; | |
module MyFunctor (Impl: {type myType;}) => { | |
let myFunc () => "hello"; | |
}; | |
module MyExample = | |
MyFunctor { | |
type myType = string; | |
}; |
This file contains 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
open ReactNative; | |
open Style; | |
type state = { | |
expression: option string, | |
keyboardRef: option ReasonReact.reactRef | |
}; | |
let updateExpression (changeEvent: Keyboard.changeEvent) self => |
OlderNewer