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
{ | |
:applications { | |
:codes ["^com\\.microsoft\\.VSCode$" "^com\\.googlecode\\.iterm2$"] | |
} | |
:input-sources { | |
:mtgap { | |
:input_source_id "org.sil.ukelele.keyboardlayout.graphite.mtgap" | |
:language "en" | |
} | |
} |
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 Printf | |
(* NOTE: | |
* 1) In OCaml syntax, function application is done with a space, for example: | |
* Java: f(x, y, z) | |
* OCaml: f x y z | |
* 2) types are read backwards, for example: | |
* `int list` is read as "list of ints" | |
* `(int, string) result is read as "result of ints and strings" |
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 Printf; | |
module Unicode = Zed_utf8; | |
let isPalindrome = aString => { | |
Unicode.compare(aString, Unicode.rev(aString)) == 0 | |
}; | |
let main = { | |
let testCases = [| |
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 Core; | |
let fix = (f, g) => ((x, a) => f(x(x), a))((x, a) => f(x(x), a), g); | |
let make_line = (n, width) => { | |
let blanks = String.make((width - n) / 2, ' '); | |
let stars = String.make(n, '*'); | |
blanks ++ stars ++ blanks ++ "\n"; | |
}; |
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 Core; | |
let make_line = (n, width) => { | |
let blanks = String.make((width - n) / 2, ' '); | |
let stars = String.make(n, '*'); | |
blanks ++ stars ++ blanks ++ "\n"; | |
}; | |
let rec make_rest = (n, width, concat) => | |
if (n <= 0) { |
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
let%test "two plus two is five" = | |
let ( + ) 2 2 = 5 in | |
(2 + 2) = 5 |
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
import Control.Applicative | |
-- Create a Person data type | |
data Person = Person { | |
name :: String, | |
age :: Int, | |
language :: String | |
} deriving (Show) | |
-- Person is a data constructor, and has a function signature of |