Skip to content

Commit

Permalink
Merge pull request #306 from marionebl/add-implementation-stubs
Browse files Browse the repository at this point in the history
add implementation stubs (fixes #285, fixes #298)
  • Loading branch information
sshine authored Jul 30, 2019
2 parents 6924a06 + 1744a24 commit 6971e92
Show file tree
Hide file tree
Showing 48 changed files with 335 additions and 1 deletion.
1 change: 1 addition & 0 deletions exercises/acronym/acronym.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let acronym _ = failwith "'acronym' is missing"
4 changes: 4 additions & 0 deletions exercises/all-your-base/all_your_base.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type base = int

let convert_bases ~from ~digits ~target =
failwith "'convert_bases' is missing"
14 changes: 14 additions & 0 deletions exercises/allergies/allergies.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type allergen = Eggs
| Peanuts
| Shellfish
| Strawberries
| Tomatoes
| Chocolate
| Pollen
| Cats

let allergic_to _ _ =
failwith "'allergic_to' is missing"

let allergies _ =
failwith "'allergies' is missing"
2 changes: 2 additions & 0 deletions exercises/anagram/anagram.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let anagrams _ _ =
failwith "'anagrams' is missing"
4 changes: 4 additions & 0 deletions exercises/anagram/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
(name runtest)
(deps (:x test.exe))
(action (run %{x})))

(env
(dev
(flags (:standard -warn-error -A))))
5 changes: 5 additions & 0 deletions exercises/atbash-cipher/atbash_cipher.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let encode ?block_size _ =
failwith "'encode' is missing"

let decode _ =
failwith "'decode' is missing"
4 changes: 4 additions & 0 deletions exercises/atbash-cipher/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
(name runtest)
(deps (:x test.exe))
(action (run %{x})))

(env
(dev
(flags (:standard -warn-error -A))))
5 changes: 5 additions & 0 deletions exercises/beer-song/beer_song.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let verse _ =
failwith "'verse' is missing"

let lyrics ~from ~until =
failwith "'lyrics' is missing"
2 changes: 2 additions & 0 deletions exercises/binary-search/binary_search.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let find _ _ =
failwith "'find' is missing"
2 changes: 2 additions & 0 deletions exercises/bob/bob.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let response_for _ =
failwith "'response_for' is missing"
10 changes: 10 additions & 0 deletions exercises/bowling/bowling.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type t

let new_game =
failwith "'new_game' is missing"

let roll _ _ =
failwith "'roll' is missing"

let score _ =
failwith "'score' is missing"
2 changes: 2 additions & 0 deletions exercises/change/change.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let make_change ~target ~coins =
failwith "'make_change' is missing"
4 changes: 4 additions & 0 deletions exercises/change/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
(name runtest)
(deps (:x test.exe))
(action (run %{x})))

(env
(dev
(flags (:standard -warn-error -A))))
4 changes: 4 additions & 0 deletions exercises/connect/connect.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type player = O | X

let connect _ =
failwith "'connect' is missing"
51 changes: 51 additions & 0 deletions exercises/custom-set/custom_set.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module type ELEMENT = sig
type t
val compare : t -> t -> int
end

module Make(El: ELEMENT) = struct
type t = El.t list
type el = El.t

let el_equal _ _ =
failwith "'el_equal' is missing"

let is_empty _ =
failwith "'is_empty' is missing"

let is_member _ _ =
failwith "'is_member' is missing"

let is_subset _ _ =
failwith "'is_subset' is missing"

let is_disjoint _ _ =
failwith "'is_disjoint' is missing"

let equal _ _ =
failwith "'equal' is missing"

let of_list _ =
failwith "'of_list' is missing"

let add _ _ =
failwith "'add' is missing"

type status = [
| `OnlyA
| `OnlyB
| `Both
]

let diff_filter _ _ _ =
failwith "'diff_filter' is missing"

let difference _ _ =
failwith "'difference' is missing"

let intersect _ _ =
failwith "'intersect' is missing"

let union _ _ =
failwith "'union' is missing"
end
8 changes: 8 additions & 0 deletions exercises/difference-of-squares/difference_of_squares.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let square_of_sum _ =
failwith "'square_of_sum' is missing"

let sum_of_squares _ =
failwith "'sum_of_squares' is missing"

let difference_of_squares _ =
failwith "'difference_of_squares' is missing"
4 changes: 4 additions & 0 deletions exercises/dominoes/dominoes.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type dominoe = (int * int)

let chain _ =
failwith "'chain' is missing"
2 changes: 2 additions & 0 deletions exercises/etl/etl.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let transform _ =
failwith "'transform' is missing"
2 changes: 2 additions & 0 deletions exercises/forth/forth.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let evaluate _ =
failwith "'evaluate' is missing"
15 changes: 15 additions & 0 deletions exercises/grade-school/grade_school.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
open Base

module Int_map = Map.M(Int)
type school = string list Int_map.t

let empty_school = Map.empty (module Int)

let add _ _ _ =
failwith "'add' is missing"

let grade _ _ =
failwith "'grade' is missing"

let sorted _ =
failwith "'sorted' is missing"
4 changes: 4 additions & 0 deletions exercises/hamming/hamming.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type nucleotide = A | C | G | T

let hamming_distance _ _ =
failwith "'hamming_distance' is missing"
18 changes: 18 additions & 0 deletions exercises/hangman/hangman.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type t

type progress =
| Win
| Lose
| Busy of int

let create _ =
failwith "'create' is missing"

let feed _ _ =
failwith "'feed' is missing"

let masked_word _ =
failwith "'masked_word' is missing"

let progress _ =
failwith "'progress' is missing"
2 changes: 2 additions & 0 deletions exercises/hexadecimal/hexadecimal.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let to_int _ =
failwith "'to_int' is missing"
2 changes: 2 additions & 0 deletions exercises/leap/leap.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let leap_year _ =
failwith "'leap_year' is missing"
4 changes: 4 additions & 0 deletions exercises/list-ops/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
(name runtest)
(deps (:x test.exe))
(action (run %{x})))

(env
(dev
(flags (:standard -warn-error -A))))
20 changes: 20 additions & 0 deletions exercises/list-ops/list_ops.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
let length _ =
failwith "'length' is missing"

let reverse _ =
failwith "'reverse' is missing"

let map ~f _ =
failwith "'map' is missing"

let filter ~f _ =
failwith "'filter' is missing"

let fold ~init ~f _ =
failwith "'fold' is missing"

let append _ _ =
failwith "'append' is missing"

let concat _ =
failwith "'concat' is missing"
2 changes: 2 additions & 0 deletions exercises/luhn/luhn.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let valid _ =
failwith "'valid' is missing"
2 changes: 2 additions & 0 deletions exercises/matching-brackets/matching_brackets.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let are_balanced _ =
failwith "'are_balanced' is missing"
4 changes: 4 additions & 0 deletions exercises/meetup/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
(name runtest)
(deps (:x test.exe))
(action (run %{x})))

(env
(dev
(flags (:standard -warn-error -A))))
2 changes: 2 additions & 0 deletions exercises/minesweeper/minesweeper.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let annotate _ =
failwith "'annotate' is missing"
2 changes: 1 addition & 1 deletion exercises/palindrome-products/dune
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

(env
(dev
(flags (:standard -warn-error -A))))
(flags (:standard -warn-error -A))))
16 changes: 16 additions & 0 deletions exercises/palindrome-products/palindrome_products.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type palindrome_products = {
value : int option;
factors : (int * int) list;
}

let smallest ~min ~max =
failwith "'smallest' is missing"

let largest ~min ~max =
failwith "'largest' is missing"

let show_palindrome_products _ =
failwith "'show_palindrome_products' is missing"

let equal_palindrome_products _ _ =
failwith "'equal_palindrome_products' is missing"
2 changes: 2 additions & 0 deletions exercises/pangram/pangram.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let is_pangram _ =
failwith "'is_pangram' is missing"
2 changes: 2 additions & 0 deletions exercises/phone-number/phone_number.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let number _ =
failwith "'number' is missing"
2 changes: 2 additions & 0 deletions exercises/prime-factors/prime_factors.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let factors_of _ =
failwith "'factors_of' is missing"
2 changes: 2 additions & 0 deletions exercises/raindrops/raindrops.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let raindrop _ =
failwith "'raindrop' is missing"
4 changes: 4 additions & 0 deletions exercises/react/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
(name runtest)
(deps (:x test.exe))
(action (run %{x})))

(env
(dev
(flags (:standard -warn-error -A))))
23 changes: 23 additions & 0 deletions exercises/react/react.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type 'a cell
type callback_id

let create_input_cell ~value ~eq =
failwith "'create_input_cell' is missing"

let value_of _ =
failwith "'value_of' is missing"

let set_value _ =
failwith "'set_value' is missing"

let create_compute_cell_1 _ ~f ~eq =
failwith "'create_compute_cell_1' is missing"

let create_compute_cell_2 _ _ ~f ~eq =
failwith "'create_compute_cell_2' is missing"

let add_callback _ ~k =
failwith "'add_callback' is missing"

let remove_callback _ _ =
failwith "'remove_callback' is missing"
2 changes: 2 additions & 0 deletions exercises/rectangles/rectangles.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let count_rectangles _ =
failwith "'count_rectangles' is missing"
5 changes: 5 additions & 0 deletions exercises/rna-transcription/rna_transcription.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type dna = [ `A | `C | `G | `T ]
type rna = [ `A | `C | `G | `U ]

let to_rna _ =
failwith "'to_rna' is missing"
10 changes: 10 additions & 0 deletions exercises/robot-name/robot_name.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type robot

let new_robot =
failwith "'new_robot' is missing"

let name =
failwith "'name' is missing"

let reset =
failwith "'reset' is missing"
2 changes: 2 additions & 0 deletions exercises/roman-numerals/roman_numerals.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let to_roman _ =
failwith "'to_roman' is missing"
5 changes: 5 additions & 0 deletions exercises/run-length-encoding/run_length_encoding.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let encode _ =
failwith "'encode' is missing"

let decode _ =
failwith "'decode' is missing"
2 changes: 2 additions & 0 deletions exercises/say/say.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let in_english _ =
failwith "'in_english' is missing"
5 changes: 5 additions & 0 deletions exercises/space-age/space_age.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type planet = Mercury | Venus | Earth | Mars
| Jupiter | Saturn | Neptune | Uranus

let age_on _ _ =
failwith "'age_on' is missing"
8 changes: 8 additions & 0 deletions exercises/triangle/triangle.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let is_equilateral _ _ _ =
failwith "'is_equilateral' is missing"

let is_isosceles _ _ _ =
failwith "'is_isosceles' is missing"

let is_scalene _ _ _ =
failwith "'is_scalene' is missing"
2 changes: 2 additions & 0 deletions exercises/word-count/word_count.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let word_count _ =
failwith "'word_count' is missing"
Loading

0 comments on commit 6971e92

Please sign in to comment.