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
(tree | |
(branch | |
(branch foo) | |
(branch | |
(branch bar) | |
(branch baz))) | |
(branch | |
(branch | |
(branch lorem) | |
(branch ipsum)) |
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
funny (a, b) = | |
if a < 8 then | |
match b with | |
Some thing -> | |
if is_normal thing then | |
woohoo_side_effects unit; | |
true | |
else unit | |
None -> unit | |
end; # Ends the match wouldn't be necessary if we didn't wanna discard the result |
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
## First class polymorphic modules concept | |
# export module | |
let pub Renderer = module | |
let pub render Graphics Scene s = | |
let camera = Scene.get_cam s in | |
let objects = Camera.get_vis_objects camera in | |
for obj in objects | |
Grahpics.draw_object obj |
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
./test | |
You've met with a terrible fate, haven't you? | |
fatal runtime error: Could not unwind stack, error = 5 | |
zsh: illegal hardware instruction ./test |
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
extern crate serialize; | |
use std::string::String; | |
use self::serialize::base64::MIME; | |
use self::serialize::base64::ToBase64; | |
pub fn call_whoami(username: &str, password: &str, outfile: &str) { | |
// do stuff | |
let concat = format!("{}:{}", username, password); | |
println!("DEBUG: {}", concat); |
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
File "proof.ml", line 14, characters 45-58: | |
Error: This expression has type | |
Core_kernel.Std.String.t list -> Core_kernel.Std.String.t | |
but an expression was expected of type string list Lwt.t -> 'a | |
Type Core_kernel.Std.String.t list is not compatible with type | |
string list Lwt.t |
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
# List.exists ~f:(fun x -> x < 0.) | |
[ (printf "1\n"; sin 120.); | |
(printf "2\n"; sin 75.); | |
(printf "3\n"; sin 128.); ] | |
;; | |
3 | |
2 | |
1 |
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
case "$target" in | |
*) inf "Dayum now we're sailing in deep waters" | |
echo "#undef ARCH_SIXTYFOUR" >> m.h | |
set 4 4 4 2 8 | |
arch64=false;; | |
i686-*-mingw*) inf "OK, this is a regular 32 bit architecture." | |
echo "#undef ARCH_SIXTYFOUR" >> m.h | |
set 4 4 4 2 8 | |
arch64=false;; | |
x86_64-*-mingw*) inf "Wow! A 64 bit architecture!" |
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
% sh -x ./configure -cc "xcrun -sdk iphoneos clang -arch armv7" | |
+ configure_options='-cc xcrun -sdk iphoneos clang -arch armv7' | |
+ prefix=/usr/local | |
+ bindir= | |
+ libdir= | |
+ mandir= | |
+ manext=1 | |
+ host_type=unknown | |
+ target_type= | |
+ ccoption= |
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
% sh -x ./configure -cc "xcrun -sdk iphoneos clang -arch armv7" | |
+ configure_options='-cc xcrun -sdk iphoneos clang -arch armv7' | |
+ prefix=/usr/local | |
+ bindir= | |
+ libdir= | |
+ mandir= | |
+ manext=1 | |
+ host_type=unknown | |
+ target_type= | |
+ ccoption= |